mrob
10/06/2023, 7:08 PMcode: 'RangeError', details: 'Maximum call stack size exceeded'
, in the UI I can confirm there should only be like 5 journal entries populating (pre-setting currency)mrob
10/06/2023, 7:08 PMrec.setText('aracct', ...)
Clay Roper
10/06/2023, 7:15 PMmrob
10/06/2023, 7:18 PM// require record, set to var record
// transform customer to customer payment (dynamic) - rec = record.transform({ fromType: 'customer', toType: 'customerpayment', fromId: customerId })
// set currency - rec.setText('currency', 'Euro')
// set expense account - rec.setText('aracct', arAccount)
or
// require record
// rec = record.create({ type: 'custoemrpayment' })
// rec.setText('customer', customerName)
// rec.setText('currency', 'Euro')
// rec.setText('aracct', arAccount)
Clay Roper
10/06/2023, 7:19 PMmrob
10/06/2023, 7:20 PMmrob
10/06/2023, 7:20 PMmrob
10/06/2023, 7:22 PMClay Roper
10/06/2023, 7:37 PMClay Roper
10/06/2023, 7:38 PMmrob
10/06/2023, 7:38 PMignoreFieldChange
will helpmrob
10/06/2023, 7:41 PMrec.setText({
fieldId: 'aracct',
text: '11008 Accounts Receivable : Unbilled Marketplace Revenue',
ignoreFieldChange: true
});
DynamicRecord {getMacros: ƒ, getMacro: ƒ, executeMacro: ƒ, …}
rec.getLineCount('items')
-1
vs if I use ignoreFieldChange: false
then it times out againmrob
10/06/2023, 7:41 PMClay Roper
10/06/2023, 7:52 PMClay Roper
10/06/2023, 7:55 PMmrob
10/06/2023, 8:10 PMmrob
10/06/2023, 8:13 PMClay Roper
10/06/2023, 8:13 PMmrob
10/06/2023, 8:20 PMmrob
10/06/2023, 8:21 PMreptar
10/06/2023, 9:33 PMreptar
10/06/2023, 9:34 PMmrob
10/06/2023, 9:41 PMmrob
10/06/2023, 9:43 PMClay Roper
10/09/2023, 1:43 AMmrob
10/09/2023, 5:02 AMClay Roper
10/10/2023, 3:38 AMmrob
10/11/2023, 2:50 PMreptar
10/11/2023, 2:56 PMmrob
10/11/2023, 2:57 PMreptar
10/11/2023, 2:58 PMmrob
10/11/2023, 2:58 PMUpon consulting this case internally and testing it within the internal QA environment, we do not recommend testing within the console log.
Ideally, use one of the SuiteScripts for testing such as Suitelet to test whether the code is working as intended or not.
I'll have to waste time making a script that fails nowmrob
10/11/2023, 2:59 PMreptar
10/11/2023, 3:00 PMreptar
10/11/2023, 3:01 PMmrob
10/11/2023, 3:02 PMreptar
10/11/2023, 3:04 PMmrob
10/11/2023, 3:05 PMrequire (['N/record'])
=> ...
record = require ('N/record')
=> {Event: {…}, create: ƒ, load: ƒ, copy: ƒ, transform: ƒ, …}
rec = record.create({ type: 'customerpayment', isDynamic: true })
=> DynamicRecord {getMacros: ƒ, getMacro: ƒ, executeMacro: ƒ, …}
rec.setValue('customer', 27623)
=> N.js?NS_VER=2023.1&minver=17&buildver=31238:2444 Uncaught nlobjError {id: null, code: 'RangeError', details: 'Maximum call stack size exceeded', stacktrace: "stacktrace: function nlobjError(code, error, suppr…rguments: {'undefined','aracct','undefined',-1}\n\n", suppressnotification: false, …}
reptar
10/11/2023, 3:06 PMsetValue
instead of setText
. Set text is wonky. I never use it.mrob
10/11/2023, 3:07 PMmrob
10/11/2023, 3:07 PMmrob
10/11/2023, 3:08 PMmrob
10/12/2023, 10:57 PM