How to get the integer value of recordType when I ...
# ask-stanley-ai
i
How to get the integer value of recordType when I use relatedRecords in email.send function in Suitlet?
c
AI generated answer (using internal Slack threads):
To get the script ID of a record type in SuiteScript, you can use the
Scripted Record Type
field instead of the
Record Type
field. This will allow you to source the script ID directly. Here is a simple example of how you can do this:
Copy code
javascript
var recordTypeScriptId = record.getValue({
    fieldId: 'custrecord_scripted_record_type'
});
In this example,
custrecord_scripted_record_type
is the ID of your custom field that uses the
Scripted Record Type
field type. The
getValue
function will return the script ID of the selected record type. Please note that the
Scripted Record Type
field type is different from the
Record Type
field type. The
Record Type
field type returns the internal ID of the record type, while the
Scripted Record Type
field type returns the script ID. ****** 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.825255632
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.814336956
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.810376942
Please provide your feedback on this answer.