Marty Zigman - The NetSuite Expert

Conversations with Marty Zigman

Certified Administrator • ERP • SuiteCloud

Prolecto Labs Accelerator Templates

NetSuite Vendor Bill Created From Purchase Order References

NetSuite



This article is relevant if you are working with Vendor Bills and you seek to reference the related Purchase Order Created From information.

Background

NetSuite’s general transaction architecture is to generate child records from copies of parent records.  For example, on the Sales Order, when it is time to bill, the resulting invoice is effectively a copy with a cross-reference via the Created From field.   This pattern is used extensively in the NetSuite environment.   Readers may be interested in this article which helps to illustrate this relationship.

Yet, there may be use cases where this relationship is not always true.   Curiously, if you review the SuiteScript Records Browser for the “vendorbill” record, you will see no reference to the “created from” field.     I suspect this is because NetSuite allows you to consolidated multiple purchase orders on to a single vendor bill.

Nonetheless, if you run a saved search on a vendor bill, and reference “Created From” you will get back a value.   However, it is important to understand that this value may not be reliable.

Reviewing NetSuite Vendor Bill Purchase Order  Sublist

To help illustrate this, we need to consider the use cases where multiple purchase orders are used to generate a single vendor bill.  To achieve the resulting vendor bill, we use NetSuite’ bulk “Bill Purchase Order” tool.  See related image.

When inspecting the resulting vendor bill, NetSuite conveniently supplies a purchase order sublist.  But what do you do if you need to get more purchase order information than what is supplied natively by NetSuite?   Here is where your assumptions may mislead you — most of us would use NetSuite’s built-in capacity to generate a new sublist and connect it to a saved search with information from the “created from” field supplying us the purchase order.  Indeed, you can connect it up — however, you will only be able to reference information from the most recent purchase order, not the true entire list of “created from” purchase orders.

If you inspect the underlying vendor bill record object, NetSuite supplies a “purchaseorder” sublist that contains the information you need.  Yet, from what I can tell, the list is not available in Saved Search.  When reviewing SuiteAnswers, it appears that the Created From purchase order is the most recent one.

Approach to Produce NetSuite Vendor Bill Sublist of Related Purchase Orders

Given we have a sublist of information supplied on the Vendor Bill record object, we have an opportunity to create a reliable sublist.    Here is what I would do:

  1. Get Purchase Order IDs: On the record’s beforeLoad event, get reference to the purchaseorder machine sublist.
  2. Craft Search: Dynamically generate a saved search using the list of purchase order IDs as criteria.
  3. Present Sublist: Draw a new sublist in a tab using the saved search result as the source.

While this is inconvenient compared to the point-and-click sublist generation capacities built into the platform, we do indeed have a pathway.  Respectfully, if the business does not use the bulk Bill Purchase Orders feature, then the standard “created from” technique works.

Get Help with NetSuite Expertise

After working with NetSuite for 10+ years, I need to remind myself that it’s still as important as ever to check assumptions when contemplating solving challenges in the platform.  This article is a good example of how the day-to-day reinforced use of the “Created From” reference correctly leads us to believe we can get to a single parent record — yet we may forget there may be multiple parents.

If you found this article valuable, feel free to sign up for notification of new articles.  Should you need to solve this situation, let’s have a conversation.

Marty Zigman

Holding all three official certifications, Marty is regarded as the top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. He is a former Deloitte & Touche CPA and has held CTO roles. For over 30 years, Marty has produced leadership in ERP, CRM and eCommerce business systems. Contact Marty to set up a conversation.

More Posts - Website - Twitter - Facebook - LinkedIn - YouTube

About Marty Zigman

Marty Zigman

Holding all three official certifications, Marty is regarded as the top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. He is a former Deloitte & Touche CPA and has held CTO roles. For over 30 years, Marty has produced leadership in ERP, CRM and eCommerce business systems. Contact Marty to set up a conversation.

Biography • Website • X (Twitter) • Facebook • LinkedIn • YouTube

3 thoughts on “NetSuite Vendor Bill Created From Purchase Order References

  1. You can also make use of “Applied To Transaction” field in saved search if you want to get more information from POs, that is not supplied in Related Records tab of Bill. By doing this, you can also create sublist easily in Vendor Bill transaction..

  2. Marty, I learned something interesting about this: If the sublist is even in the afterSubmit of the VB creation event (i.e. scriptContext.type is ‘create), the sublist will be empty. Just like tranid, it seems NetSuite sets this post-afterSubmit upon creation.

    To access the PO reference in this state, the header field ‘podocnum’ can be used. Note: Once the VB has been saved, this field will no longer be accessible.

    So the logic should look like this:

    if (rec.getValue(‘podocnum’)) {
    // VB is being created; sublist not ready yet
    } else {
    // Parse ‘purchaseorders’ sublist for PO IDs.
    }

  3. Marty Zigman says:

    Hello Chidi,

    Thank you. The podocnum is an important capacity to understand. This will help clarify the logic required as we build our automated vendor bill-to-purchase order enhancements.

    Marty

Leave a Reply

Your email address will not be published. Required fields are marked *