tiger
05/21/2025, 3:34 AMCeligo AI
05/21/2025, 3:34 AMAI generated answer (using internal Slack threads):To get all field names by the currentRecord context in SuiteScript, you can use the
getFields()
method. However, this method is not directly available in the currentRecord
module. You would need to load the record first to use this method.
Here is a sample code snippet:
javascript
var recordType = currentRecord.type; // get the type of the current record
var recordId = currentRecord.id; // get the id of the current record
var recordObj = record.load({
type: recordType,
id: recordId
});
var allFields = recordObj.getFields(); // get all field names
In this code, recordType
and recordId
are used to load the record. The getFields()
method is then called on the loaded record to get all field names.
Please note that this method returns an array of field names. If you want to filter the fields that start with 'custrecord', you can use the filter()
method on the returned array.
javascript
var customFields = allFields.filter(function(fieldName) {
return fieldName.startsWith('custrecord');
});
In this code, customFields
will contain an array of field names that start with 'custrecord'.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
05/21/2025, 3:34 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.800278366
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.799245596
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.798247814
Celigo AI
05/21/2025, 3:34 AM