RE: How to setValue status custom transaction (type basic) in suiteScript ?

Hi There,
I have custom transaction type basic and use standard status at tab statuses with show status field is set checked.
Then I declare any status like Draft, Open and Completed.

I have some condition using suitescript to make different status, as usual I will load that custom transaction then setValue the status field. but unfortunately the status not changed

            var recordSPBP = record.load({
                type: 'customtransaction_spbp',
                id: id_spbp,
                isDynamic: true
            recordSPBP.setValue('custbody_spbp_related_statistical', id_statistical);
            // I am trying make sure status field id is current using 'status'
            var status = recordSPBP.getValue('status');
// I have the status value with value is 'Draft' as string
            log.debug('status '+typeof status, status);
// Already try between setText or setValue, but the status not changed
            // recordSPBP.setText('status', 'Completed');
            recordSPBP.setValue('status', 'Completed');
rianluthfi Rookie Asked on March 8, 2023 in SuiteScript.
Add Comment
3 Answers

May I ask where did you put your code in the part of the script? Is it BL, BS or AS? Also, does it prompt an error?

Rookie Answered on March 9, 2023.

Originally I am using Schedule Script to trigger change Status of Custom Transaction, and of course, I am trying at another trigger like in BL, BS and AS.
But if you see in my script, I am using record.load, so this script can trigger at any trigger.

Then when running that script, no error appear

on March 9, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.