ajrey77
04/02/2025, 10:37 PMCeligo AI
04/02/2025, 10:37 PMAI generated answer (using internal Slack threads):Based on the conversations, there are a few issues when trying to clear the checknumber field on a customer refund in afterSubmit: 1. Inability to directly edit the record object passed in the parameters of a user event: You cannot directly edit the record object passed in the parameters of a user event; you must load the record independently. This means that you cannot directly set the checknumber field to null in the afterSubmit event. 2. The checknumber field is automatically populated by NetSuite: NetSuite automatically populates the checknumber field based on the transaction number. This automatic population cannot be turned off, which means that even if you clear the checknumber field in the afterSubmit event, it will be repopulated by NetSuite. 3. The transaction number is not populated in the record object in the afterSubmit event: The transaction number, which is used to populate the checknumber field, is not available in the record object in the afterSubmit event. This means that you cannot use the transaction number to clear the checknumber field in the afterSubmit event. Here is a code sample provided in the conversations that attempts to override the transaction number field on a customer refund:
javascript
let documentLookup = search.lookupFields({
type : search.Type.CUSTOMER_REFUND,
id : recordID,
columns : ['transactionnumber']
});
let values = {};
values.tranid = documentLookup.transactionnumber;
record.submitFields({
type : record.Type.CUSTOMER_REFUND,
id : recordID,
values : values
});
However, this code does not clear the checknumber field, but instead sets the transaction number field to the current transaction number, which does not solve the issue.
******
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/02/2025, 10:37 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.838357151
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.82984972
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.8242
Celigo AI
04/02/2025, 10:37 PM