Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Netsuite record.load

I can load a record with a hardcoded ID, but I’m not sure how to get this dynamically during a create on after submit method for a user event script. This code is in an if block for UserEventType create. Is there some variable to use for id for newrecord?

thank you

            var Bill = record.load({
                type: record.Type.VENDOR_BILL, 
                id: 13295,
                isDynamic: true
                });

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

On create the record id is not available until the after submit phase. There you can get it from the newRecord

function afterSubmit(context){
    const newRec = context.newRecord;
    const billRec = record.load(
        type:newRec.type,
        id:newRec.id,
        isDynamic:true
    });
    ...
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading