on 11-04-2011 5:54 AM
Hi All,
I have written a script on onLoad for a contract(2002 class). I have to enable/disable an extension collection based on the phase in which the contract is there. So i have written the following code.
phase=doc.getCurrentPhase().getDisplayName();
if(("Executed").equalsIgnoreCase(phase))
IapiDocumentLockManager.unlockField(session,doc,"Coll_attachment");
else
IapiDocumentLockManager.lockField(session,doc,"Coll_attachment");
But the problem is doc.getCurrentPhase().getDisplayName() is returning a value only when the contract is in draft stage. If the contract is moved to any other phase like supplier draft, waiting for approval or executed doc.getCurrentPhase().getDisplayName() is not returning anything.
Thanks in advance.
Hi
Try doc.getCurrentPhase().getDisplayName(session) instead of doc.getCurrentPhase().getDisplayName() and see if it makes a difference.
Rest looks fine.
Regards
Mudit Saini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mudit,
Thanks for the reply....
I have tried with getCurrentPhase().getDisplayName(session) but it is throwing some exception. Instead tried getCurrentPhase().getDisplayName() then it atleast displayed Draft phase.
Is there anything we are missing like do we need to do anything from configuration?
Thanks,
Srikanth Emani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.