How do I obtain the sublist id on a custom record?
# ask-stanley-ai
a
How do I obtain the sublist id on a custom record?
c
AI generated answer (using internal Slack threads):
To obtain the sublist id on a custom record in NetSuite, you can use the
getSublists()
method. This method returns an array of sublist names (internal ids) on the record. Here is an example of how you can use it:
Copy code
javascript
const sublists = parentRecord.getSublists();
However, please note that if your sublist was created by a parent-child relationship, the internal id of the sublist would begin with 'recmac'. Also, it's important to ensure that the 'Allow Child Editing' option is enabled for your child record. This needs to be enabled to make the sublist accessible via scripting. The linking field in the child record also needs to have 'Show in list' checked. If you're still having trouble accessing the sublist, you might need to load the record using
record.load()
, and fetch the sublist values from there. Please note that there might be limitations when it comes to accessing custom record sublists, especially when using the
Advanced PDF templates
. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.87976855
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.877942383
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.869347572
Please provide your feedback on this answer.