Skip to Content
avatar image
Former Member

doc.getCurrentPhase doesnt return Executed phase

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Nov 04, 2011 at 07:01 AM

    Hi

    Try doc.getCurrentPhase().getDisplayName(session) instead of doc.getCurrentPhase().getDisplayName() and see if it makes a difference.

    Rest looks fine.

    Regards

    Mudit Saini

    Add comment
    10|10000 characters needed characters exceeded