Luis
03/28/2023, 12:23 AMLuis
03/28/2023, 12:23 AMfunction saveRecord(context) {var rec = context.currentRecord
var rejId = rec.id
var rejector = rec.getValue({ fieldId: REJECTOR })
var tranId = rec.getValue({ fieldId: TRANSACTION })
var tranType = rec.getText({ fieldId: TRANSACTION}).split(' ')[0];
console.log('tranType = ' + tranType)
switch(tranType){
case 'Bill':
tranType = record.Type.VENDOR_BILL;
break;
case 'Journal':
tranType = record.Type.JOURNAL_ENTRY;
break;
case 'Invoice':
tranType = record.Type.INVOICE;
break;
case 'Vendor':
tranType = record.Type.VENDOR_PREPAYMENT;
break;
case 'Credit':
tranType = record.Type.CREDIT_MEMO;
break;}
var reason = rec.getValue({ fieldId: REASON })
Anthony OConnor
03/28/2023, 12:29 AMAnthony OConnor
03/28/2023, 12:33 AMtranType
to the correct string from the record.Type enumAnthony OConnor
03/28/2023, 12:35 AMtranType
variable.
first it uses it to hold the value from rec.getText
and then based on the first word in that, it will get the correct string for the transaction typeLuis
03/28/2023, 1:49 AMLuis
03/28/2023, 3:16 AMAnthony OConnor
03/28/2023, 3:20 AMLuis
04/09/2023, 3:30 AM