Isaac Rumbold
11/22/2024, 2:15 PMCeligo AI
11/22/2024, 2:16 PMAI generated answer (using internal Slack threads):****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** To find the sublist ID of a custom sublist on an item, you can use the
getSublists()
method in SuiteScript 2.0. This method returns an array of all the sublist IDs in the record. Here is an example of how you can use it:
javascript
var parentRecord = record.load({
type: record.Type.SALES_ORDER,
id: '123'
});
var sublists = parentRecord.getSublists();
In this example, sublists
will be an array of all the sublist IDs in the sales order record with ID '123'. You can then iterate over this array to find the sublist you are interested in.
If your sublist was created by a parent-child relationship, the internal ID of the sublist usually begins with 'recmac'.
Please note that you cannot script a custom sublist that is driven by a search. If you need to find a specific line in the sublist, you can iterate through the sublist rows or use the findSublistLineWithValue()
method if you know the ID of the item.Celigo AI
11/22/2024, 2:16 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.867893338
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83860141
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837387741
Celigo AI
11/22/2024, 2:16 PM