on 05-30-2014 6:43 PM
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.
Well, I could find a fix for that.
My mistake was that 1: I wasn't getting the correct ntype code for my value list type. And 2: I wasn't giving the Id name.
The new result came as this:
statusObjRef = doc.getStatusRef();
statusHome = IBeanHomeLocator.lookup(session,statusObjRef);
status = statusHome.findUniqueByNameType("Drafting Agreement", 1);
doc.setStatusRef(status.getObjectReference());
In case anyone has this problem, you should check the collection of values internal id, that's the actual ntype code (the number you send on the second parameter).
But I could still use help having some advice on the Master Agreement elements handling (getting data from the master agreement or the data thas is being edited at the moment before saving).
If anyone could give some advice, they would be very welcome
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.