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

Status are usually a combination of type and letter (see this helpful article). Even if the system displays “Completed”, if you send it back it won’t understand it.

To be sure of your status real code, you should create a saved search by UI and use the “Netsuite: Search Export” Chrome addon and click on “Export as Script” after saving your Saved Search.

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

Rookie Answered on March 9, 2023.

Hi Caroline, thank you for your reference,
But in my issue, I have issue change status in Custom Transaction type. in your reference is for Standard Transaction that already built in NetSuite.
And I already check using plugin NetSuite Export for saved search, unfortunately no one that condition can change status via script

This is ID Status of Custom Transaction

Internal ID Status Custom TransactionInternal ID Status Custom Transaction

This is value when I check at NetSuite Export Plugin

Check in NetSuite ExportCheck in NetSuite Export

And this is my testing value of status field, and the output of value only description of Status (not ID)

Log Debug Field StatusLog Debug Field Status

// I am already try this combination

but no one that can change the Status from Draft  (A) to Completed (C)

on March 9, 2023.

Hi Rian, You deleted the field Id in your set just for the examples right? Have you tried setValue with ‘orderstatus’ instead of ‘status’? I would try a setValue(‘orderstatus’, ‘C’) just in case as you are on a transaction custom record type.

on March 10, 2023.
Add Comment

Your Answer

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