ANS-1080 · SUITESCRIPT DEVELOPMENT
How to Link Vendor Bills to Purchase Orders in NetSuite’s Related Records Subtab?
Understand how NetSuite automatically links transactions and when manual intervention or advanced scripting is needed for Vendor Bills and Purchase Orders.
Short answer
NetSuite's 'Related Records' subtab automatically displays Vendor Bills created from Purchase Orders via record transformation. For comprehensive linking, especially with multiple Purchase Orders, line-level fields or custom solutions are often required, as the header-level 'Created From' field may be insufficient.
Scenario
Users need to ensure that Vendor Bills are correctly linked to their originating Purchase Orders and appear under the 'Related Records' subtab on the Purchase Order record. This linking is crucial for tracking and reporting, but the automatic behavior may not always capture all relationships, particularly in complex scenarios.
Solution
The 'Related Records' subtab on a Purchase Order is designed to display various transaction types that are either 'Created By' or 'Created From' the Purchase Order.When a Vendor Bill is generated from a Purchase Order using a record transformation, such as through the SuiteScript 2.x record.transform(options) function, the system typically populates the header-level 'Created From' field on the Vendor Bill. This action should automatically establish the link, causing the Vendor Bill to appear in the 'Related Records' subtab of the originating Purchase Order.However, the header-level 'Created From' field on a Vendor Bill may only link to a single Purchase Order. For scenarios where a Vendor Bill is associated with multiple Purchase Orders, or when a more robust linking mechanism is required, relying solely on the header-level 'Created From' field can be insufficient. In such cases, it is often necessary to leverage line-level fields like 'orderdoc' (Purchase Order internal ID) and 'orderline' (Purchase Order line ID) on the Vendor Bill lines, or to implement custom scripting solutions to ensure all relevant Purchase Orders are accurately reflected in the 'Related Records' subtab. Manual linking or custom script logic may also be required if the Vendor Bill is created through methods other than direct record transformation.
Expert NetSuite Support
Need help with this NetSuite issue?
SuiteScript Development consulting and configuration support
