NetSuite automatically generates a hidden ‘mapping’ table for every multiple-select field. This table establishes a many-to-many relationship between two tables. It contains only two fields:
mapone: The internal ID of the source record.
maptwo: The internal ID of the target record.
This table establishes a many-to-many relationship between two tables. The table name follows the format: map_XXX_YYY, where:
XXX: The internal ID of the source table.
YYY: The internal ID of the multiple-select field.
NetSuite Multiple Field SQL Lookup Syntax
The original query retrieves the application name, ID, and the multi-select field named custrecord_curated_application_dist_accts as MULTIFIELD. This field contains comma-separated internal IDs of the selected options.
The joined query expands on this information by:
Joining the map_customrecord_curated_application_custrecord_curated_application_dist_accts table (based on the naming convention you described). This table links the application record (identified by mapone) with the selected application distribution accounts (identified by maptwo).
Joining the customrecord_curated_application_accts table based on the maptwo field from the mapping table. This allows you to retrieve the actual names or details of the selected account IDs.
The resulting table shows the application name, ID, original multi-select field value, the internal IDs from the mapping table (MAPTWO), and the actual account IDs (ACCTNUM) linked to the application.
Leave a Reply