Imran Hasan
08/28/2024, 6:36 AMCeligo AI
08/28/2024, 6:36 AMAI generated answer (using internal Slack threads):To set a document number in a list/record field using a script, you can use the
setText
method in SuiteScript. However, this method may not work in a Map/Reduce script as it does in a scheduled workflow.
Here is an example of how you can set a document number in a list/record field:
javascript
var soString = 'Sales Order #' + docId;
newRec.setText({
fieldId: 'custrecord_salord',
text: soString
});
In this example, docId
is the document number you want to set. The setText
method sets the value of the 'custrecord_salord' field to the string 'Sales Order #' concatenated with the document number.
If you are using a Map/Reduce script, it might be more efficient to send the internal ids to the script instead of the document number (tranid). You can then use the record.submitFields
method with the internal id. If you still need to use the document number, you can return a search or query in the getInputData
stage to get the internal ids of the transactions from the given document numbers.
******
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
08/28/2024, 6:36 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833626807
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.816213846
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.814565957
Celigo AI
08/28/2024, 6:36 AM