Saved Search which includes child customer’s transactions

One of the fantastic things NetSuite supports is parent/child relationships among customers. The problem is figuring out how to write a saved search that leverages that.

I’ve been missing until now a relationship on customer records called “Top Level Parent Fields…” The second relationship is is “Transaction Fields…” Combine those two and you get the missing link (pun intended) which allows you to show all transactions for both the parent company and all its kids.

This is the criteria you’d use to pull one parent-company and all child-company transactions into one result set. If you wanted to reference this from SuiteScript, say inside a Suitelet, you’d remove the “Top Level Parent: Company Name” and add a filter on “Top Level Parent: Internal ID” or {toplevelparent.internalid}. You could also move this filter from Criteria in the Available Filters tab .

Here, my result set includes a list of parent customers followed by the child customer that actually had the transaction. All fields on the transaction record are available. I’ve just pulled a few as an example.

As you continue to create transactions, you will probably want to filter on “Transation Fields: Date” or {transaction.date}, either in the criteria saved with your search, or in the code that references this search.

Here is a simple example of how to filter directly in the saved search.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s