Hi Experts!
I'm trying to change the Status of a Master Agreement When the agreement is saved.
For that I created a script that runs after the Agreement saves.
The script is the following:
statusObjRef = doc.getStatusRef();
statusHome = IBeanHomeLocator.lookup(session,statusObjRef);
status = statusHome.findUniqueByNameType("Borrador", 10);
doc.setStatusRef(status.getObjectReference());
The problem I'm encountering is that, even after the status text actually changes to the status i'm changing it by code, after I save again (to be sure that the new status will be saved) and exit, the status doesn't change. It remains as the original. It seems to me that the code is only changing the text, but not actually changing the status.
Is there any way I could achieve what i'm looking for?
Also, any other tips on how to get information of the Master Agreement, or how to edit it by script would be very helpful
Thanks in advance!
Oscar Obeso.