Workflow Action Script - get oldRecord I'm trying ...
# suitescript
a
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
Is your wf action set to trigger on after record submit?
a
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