Resources / Article
NetSuite update Addressee when company name changes
Update the vendor Addressee when the company name changes: where NetSuite keeps the value, and the script that writes it back.
Update the Addressee by writing to the address subrecord on the vendor. Editing the company name on the vendor record leaves the Addressee as it was, because NetSuite reads that value from the address itself (Oracle help).
Where the Addressee is stored
Oracle's e-invoicing mapping shows the addressee being read from the entity's address subrecord (Oracle help). The PEPPOL template page notes that the party name element does not display when the addressee on the subsidiary's main address is absent, or when the subsidiary name is absent (Oracle help).
"NetSuite Field Update - Update Addressee when Company Name is updated on Vendor Record" (Stack Overflow)
Transactions hold a copy of their own. On outbound purchase documents, the bill addressee on the transaction is used, and the vendor's company name is the fallback when that address field is empty (Oracle help). On sales documents the same rule uses the customer's company name (Oracle help).
So when the accounts team types a new name into Company Name, the address keeps the text it already had. Which addresses a vendor holds depends on the account setup, so open one vendor and read the address list before you plan the change.
Step 1: Find the vendors with a stale Addressee
Export the vendor list and read the address columns in the file. Keep the internal ID of every vendor you plan to touch.
Step 2: Decide which addresses to update
List the addresses each vendor uses on documents and read them one at a time. A trading name that changed for one entity can still be right on another. Write the rule into the requirements document you keep for the account (BRD template).
Step 3: Deploy a user event script on the vendor record
The script below is SuiteScript 2.1. It reads the company name on the vendor, compares it with the value on the saved record, and writes the new name into the addressee on each address line that still holds the old name.
/**
* @NApiVersion 2.1
* @NScriptType UserEventScript
*/
define(['N/record'], (scriptContext) => {
const syncAddressee = (context) => {
if (context.type !== context.UserEventType.EDIT) return;
const rec = context.newRecord;
const newName = rec.getValue({ fieldId: 'companyname' });
const oldName = context.oldRecord.getValue({ fieldId: 'companyname' });
if (!newName || newName === oldName) return;
const lines = rec.getLineCount({ sublistId: 'addressbook' });
for (let i = 0; i < lines; i++) {
const address = rec.getSublistSubrecord({
sublistId: 'addressbook',
fieldId: 'addressbookaddress',
line: i
});
if (!address) continue;
const current = address.getValue({ fieldId: 'addressee' });
if (current && current !== oldName) continue;
address.setValue({ fieldId: 'addressee', value: newName });
}
};
return { beforeSubmit: syncAddressee };
});
The line if (current && current !== oldName) continue; leaves an addressee that a user typed by hand alone. Field IDs and subrecord access vary by record type and account setup, so confirm both on a sandbox copy of the client's account and test with one vendor before you deploy.
Step 4: Backfill the vendors already renamed
The script covers changes made after deployment. For the backlog, run a scheduled script that loads each vendor from step 1, applies the same rule, and saves the record. Keep the internal IDs so a failed batch can be re-run.
Step 5: Verify on a document
Open a vendor and read the addressee on each address. Then raise a test purchase order and read the bill-to address on it, and do the same on a sales document (Oracle help).
Worked example
A Pune distributor holds a vendor registered as Sharma Industrial Supplies Pvt Ltd with three addresses on the record. In April the vendor registers a new name, Sharma Industrial Supplies India Pvt Ltd, and the accounts team edits the Company Name field on the vendor.
Two weeks later a purchase order for INR 4,50,000 goes out. The bill-to address on the order reads Sharma Industrial Supplies Pvt Ltd, because the addressee on the vendor's bill-to address was never changed and the order used the billing address stored on the transaction (Oracle help). The buyer's AP team queries the mismatch.
The script writes the new name into the addressee on the addresses where it still held the old name. A scheduled run covers the other vendors renamed that year. The next purchase order carries the new name.
Trade-offs
- A script writes to the address subrecord, which is where NetSuite reads the addressee from (Oracle help). A change to the vendor's company name alone leaves that value in place.
- Overwriting an addressee that a user typed by hand loses useful detail, so the script compares the current value with the old company name before writing.
- Historical transactions hold their own billing address (Oracle help). Leaving those as issued is usually the right answer for audit.
- A vendor with several addresses needs a rule for each address. One blanket change can hit an address that was never wrong.
- The vendor record feeds e-document templates and integrations, so test on a sandbox and check the documents the client sends.
Common mistakes
- Changing the company name on the vendor and expecting the addressee to follow (Oracle help).
- Updating the main address and leaving the bill-to address stale.
- Overwriting an addressee that a user set to a contact name.
- Rewriting the billing address on posted transactions, which changes documents already issued.
- Skipping the sandbox test, then finding the subrecord field ID behaves differently on the client's account.
FAQ
Does a workflow field update reach the Addressee?
The addressee value sits on the address subrecord (Oracle help). A field update that names a field on the vendor record changes that vendor field, and the addressee keeps the text it already had.
How do past transactions behave when the vendor name changes?
The transaction's own billing address is used, and the vendor company name is the fallback when that field is empty (Oracle help).
Does the same rule apply to customers?
Yes. On sales documents the bill addressee on the transaction is used, with the customer's company name as the fallback (Oracle help).
The quick way is mark., which reads the client's NetSuite account read only and names the exact fix for the Addressee. Try it free.
Sources
- docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_0423105418.html
- docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1102072224.html
- docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1102072308.html
- docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1116115058.html
- docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1116120404.html
- docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N976686.html
Have mark. check this against the client's own files
mark. reads the client's files and sets each point against them, with the source beside it.
Twenty minutes on one client folder. Your 21-day trial opens on the call.