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