How is this action being called? I've tested escalation & a UI push button with similar code to yours and it works in my 7.6.1.2 environment.
My guess is that there is another save occurring before this code fires. If that's the case saving the set a second time won't work and would explain why the WORKORDER record itself isn't updating. As an example, I added a save at the beginning of my script and left the one at the end after the status change. I made a change to the record (updated the description) and called my action. In that scenario the description is saved, the status history is recorded, but the work order is not updated.
I wouldn't personally use the 9L (suppressing action & validation) but I tested the script with it and it also worked in my environment. The reason I don't like suppressing action and validation is it either does nothing (which makes it pointless to have) or it does something bad (suppresses validation) that you really don't want to occur on a status change. I tested a few scenarios (going back from COMP->INPRG, having a condition on the status that would make it not valid, etc.) and the errors are still thrown so I'm assuming this is mostly at least a case of it not doing anything.
------------------------------
Steven Shull
IBM
------------------------------
Original Message:
Sent: 06-22-2022 22:40
From: Alief Harry
Subject: Automation Script Change Status
Hi Steven,
My launch point for automation script is ACTION and this object is WORKORDER, yes I use MboConstants for changeStatus.
I will show my script, here is my script :
Thank you.
------------------------------
Alief Harry
PT Indonesia Comnets Plus
Original Message:
Sent: 06-22-2022 10:52
From: Steven Shull
Subject: Automation Script Change Status
What was your launch point for the automation script to change the status? And were you providing any of the MboConstants to suppress logic?
Some launch points, such as actions, don't explicitly save. And the changeStatus action doesn't call a save. The dialog triggers a save before and after and in the processes where we make status changes in the background we're explicitly calling a save. I wouldn't have expected the status entry to be committed but I'd have to look at the code to see how that's handled.
------------------------------
Steven Shull
IBM
Original Message:
Sent: 06-22-2022 00:01
From: Alief Harry
Subject: Automation Script Change Status
Hi Guys,
Have you ever experienced when you want to change the workorder status using a script but it doesn't work?
I changed the status of the workorder using the changeStatus function in the script, but the only thing that changed was the status in wostatus and the status in the workorder did not change. I need to change the state on the workorder object, please help me
#Customizations
------------------------------
Alief Harry
PT Indonesia Comnets Plus
------------------------------