Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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.

Former Member
Not what you were looking for? View more on this topic or Ask a question