ANS-0671 · PURCHASE & VENDOR MANAGEMENT
How to Link Purchase Orders to Vendor Bills in NetSuite
Implement a custom field and scripting to associate Purchase Order internal IDs with Vendor Bill line items for improved traceability.
Short answer
To link Purchase Orders to Vendor Bills, create a custom column field deployed on both records. Populate this field with the PO internal ID on line items after PO submission. Then, on new Vendor Bills, retrieve these PO IDs from line items in a beforeLoad script and add them to a custom dropdown field.
Scenario
Users need to retrieve the associated Purchase Order (PO) information directly from a Vendor Bill. The standard NetSuite functionality does not directly expose the PO internal ID as a supported sublist field on Vendor Bills, making it challenging to establish a direct programmatic link between the two record types.
Solution
The solution involves creating a custom column field and implementing scripting to link Purchase Orders (POs) to Vendor Bills.
Create a custom column field that is hidden and deployed on both Purchase Orders and Vendor Bills.
After a new Purchase Order is submitted, use an afterSubmit script to add the PO's internal ID to this custom column field on its line items. These line items will subsequently appear on the Vendor Bill.
On a new Vendor Bill, implement a beforeLoad script (specifically for type create) to loop through the line items. Retrieve the Purchase Order internal IDs from the custom column field on each line.
Add the retrieved Purchase Order internal IDs to a custom drop-down field on the Vendor Bill.It is important to note that purchaseorder is not a supported sublist internal ID, as indicated by the NetSuite Record Browser. For Vendor Bills that have already been created, users should utilize the "Related Records" tab to view associated Purchase Orders.
Expert NetSuite Support
Need help with this NetSuite issue?
Purchase & Vendor Management consulting and configuration support
