Shelby Owens
04/10/2025, 2:30 PMCeligo AI
04/10/2025, 2:30 PMAI generated answer (using internal Slack threads):The
record.submitFields method in SuiteScript 2.0 requires the record type to be passed as a string. When you use record.Type.CUSTOMER, you are referencing an enumeration value, which is not a string. This is why you are getting the error "Missing a required argument: type".
When you change it to 'customer', you are passing a string, which is the correct data type for the type parameter in the record.submitFields method. This is why your script works when you use 'customer' instead of record.Type.CUSTOMER.
Here is an example of how to use record.submitFields correctly:
javascript
var recordId = record.submitFields({
type: 'customer',
id: 123,
values: {
'custbody_reject_reason': 'Some reason'
},
options: {
enableSourcing: false,
ignoreMandatoryFields : true
}
});
******
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
04/10/2025, 2:30 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.851272881
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84478718
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843270421
Celigo AI
04/10/2025, 2:30 PM