SuiteScript – Joining Custom Record Types

NetSuite has voluminous documentation. That’s great! However, sometimes finding what you need can be rough. Here is a perfect example. 

I needed to join a custom record type to its associated item. Here is the custom record type’s definition.

Custom Table Def

I wanted to show an item’s display name. The trick was not to reference the joined record type (table) in the join property. Instead, reference the field in the custom record where the join was initiated. The joined rec type is called out in that field’s definition (see above).

Code

This makes perfect sense if you think of it this way.  Your custom record type could include multiple fields linking to Items. If you supply “Items” in the “join:” parameter, SuiteScript would be unable to decide which field to join to. 

Here is what you’d expect to code. However, NetSuite reused the “join:” parameter in place of adding a “joinid:”.

Ideal

There is SuiteAnswer that deals with this. It took me FOREVER to find it. FYI… it works the same on search filters and columns.

https://netsuite.custhelp.com/app/answers/detail/a_id/37741

SuiteAnswer

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