is submitfields create new record if record not ex...
# ask-stanley-ai
c
is submitfields create new record if record not exist
c
AI generated answer (using internal Slack threads):
The
record.submitFields
method in SuiteScript does not create a new record if the record does not exist. It is used to update field values on an existing record. If you try to use
record.submitFields
on a non-existing record, NetSuite will throw an error. Here is an example of how to use `record.submitFields`:
Copy code
javascript
record.submitFields({
  type: record.Type.SALES_ORDER,
  id: '123',
  values: {
    memo: 'New memo text',
  },
  options: {
    enableSourcing: false,
    ignoreMandatoryFields: true,
  },
});
In this example, the
record.submitFields
method is used to update the 'memo' field on a Sales Order record with the internal id of '123'. If the Sales Order with id '123' does not exist, an error will be thrown. ****** 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.80922
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.80737561
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.806852
Please provide your feedback on this answer.