Admin Upskill Center

Bulk Update Vendor Contact Roles in NetSuite

Browser-console method for bulk assigning primary vendor contact roles when standard NetSuite tooling is limited.

NetSuite does not provide a straightforward built-in bulk path for setting vendor contact roles to Primary.

Use this approach when you need a one-time, controlled update and have validated IDs in advance.

Prerequisites

  • Confirm you are in the correct account and role.
  • Validate each vendorId and contactId pair before running.
  • Start in sandbox first.

Console Script

Update the pairs array with your vendor/contact mappings before execution.

// === CONFIG ===
const contactRole = -10; // Primary Contact Role internal ID
const pairs = [
    { vendorId: 674, contactId: 1360 },
];

// === DEFINE FUNCTION ===
async function addContactsSequential() {
    for (const { vendorId, contactId } of pairs) {

    const url = `/app/common/entity/companycontact.nl`;
    const body = new URLSearchParams({
        id: vendorId,
        contact: contactId,
        contactrole: contactRole,
        action: 'addcontact'
    });

    try {
        const res = await fetch(url, {
            method: 'POST',
            headers: {'Content-Type': 'application/x-www-form-urlencoded'},
            body: body.toString(),
        });
        
        console.log(`Vendor ${vendorId}, Contact ${contactId}:`, res.status);
        await new Promise(r => setTimeout(r, 500)); // throttle
        } catch (e) {
          console.error(`Vendor ${vendorId}, Contact ${contactId}:`, e);
        }
    }
}

// === RUN FUNCTION ===

addContactsSequential();

Safety Notes

  • This is an admin-side browser-console technique, not an official bulk action UI.
  • Use small batches first and confirm results before large runs.
  • Keep an export of the original relationship state when possible.