cancel
Showing results for 
Search instead for 
Did you mean: 

Set the status of the Master Agreement

Former Member
0 Kudos

Hi Guys,

i have a problem in which i have to reopen the Closed Master Agreement:

I have created a Toolbar Script  which helped me to activate the Master Agreement but  the Status of the Master Agreement was still "Closed".

Guys could any one help me a way through in which i can update the Status of the Master Agreement in the ToolBar Script Itself.

Code used is below:

MA_DOCUMENT_NUMBER="EXPLICIT MA NUMBER which we have re open"


ContractIBeanHomeIfc contractHome = (ContractIBeanHomeIfc) IBeanHomeLocator.lookup(session, ContractIBeanHomeIfc.sHOME_NAME);

ContractIBeanIfc contract = (ContractIBeanIfc) contractHome.findByUniqueDocName(MA_DOCUMENT_NUMBER);

if (contract.isClosed())

{

contractHome.upgradeToEdit(contract);

contract.setIsInactive(Boolean.valueOf(false));

contract.getFieldMetadata("CLOSED_AT").set(contract, null);

contract.getFieldMetadata("CLOSED_BY_USER").set(contract, null);

contractHome.save(contract);

}

Regards

Tarun rawat

dural.rawat@gmail.com

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member190023
Contributor
0 Kudos

Hi Tarun,

If I remember correctly, when closing, the system also marks the MA as 'cancelled'. You should also check if isCancelled() is true and to a similar update.

Also check by refreshing the document (if you are calling the script from the same MA you'll need to refresh to get the new values from DB).

PS: Your existing code should be OK, I implemented the same thing for a client (plus the CANCEL part) and it was working fine.

Bogdan