https://netsuiteprofessionals.com logo
a

Aaron Hawks

05/02/2022, 9:01 PM
Workflow Action Script - get oldRecord I'm trying to get the oldRecord within a workflow action script but it is null
This is my sample script to get the old record but it is always null
Copy code
const onAction = (scriptContext) => {
            log.debug({
                title: 'Old Record',
                details: scriptContext.oldRecord
            });

            return 0;
        }
Any suggestions?
j

Justin B

05/02/2022, 9:29 PM
Is your wf action set to trigger on after record submit?
a

Aaron Hawks

05/02/2022, 9:30 PM
I tested with before and after record submit, but I just found some really odd behavior ...
I decided to test my script in a User Event script, just to see if it would log the oldRecord. As long as I have a deployed User Event script to the same record type the Workflow Action script can access the oldRecord
So to fix my Workflow Action script I have to deploy a User Event script 🤔 I think there is a bug somewhere
2 Views