I'm trying to get the value of "voided" after a tr...
# suitescript
e
I'm trying to get the value of "voided" after a transaction has been, in fact, voided. But the value of 'voided' always comes as 'F' just after has been voided. The transaction IS voided, as appear in the UI, queries, other scripts, etc. Here I'm using a beforeSubmit script. (Also tried with afterSubmit)
Copy code
transactionNewRecord = context.newRecord;
log.audit({ title: 'Is Voided?', details: transactionNewRecord.getValue('approvalstatus')}); //Comes as 'F'... why?
if(transactionNewRecord.getValue('voided')==='T'){
    transactionNewRecord.setValue('approvalstatus',3);
    transactionNewRecord.save();
}
b
load the record again in the after submit
e
facepalm
Thanks @battk It works now! 🙂