cancel
Showing results for 
Search instead for 
Did you mean: 

CLM Contract Document Template Change Phase Error

Former Member
0 Kudos

Hi all,

     I use the following code to change the contract document template(1805) in script of the phase.

        template.getIBeanHomeIfc().upgradeToEdit(template);

        template.getIBeanHomeIfc().changePhase(template, "Approved");

        template.getIBeanHomeIfc().save(template);

        template.getIBeanHomeIfc().downgradeToView(template);

    But NumberFormatException is thrown.

  

     I use the phase object ID as a parameter or the use of 1/2/3/4 as parameter are thrown NoSuchElementException.

        template.getIBeanHomeIfc().changePhase(template, "-2147483545");

    I want to get current_phase or other_phase value during the contract document template(1805) before change(Pre Phase Change). But the change did not enter this code.

     I don't know what to make of this function successfully use parameters. I do not know where you can view the four phase of the contract document template corresponding to the digital.

     Anyone can help me? Thank you very much.

Regards,

Jacky Cheng

Accepted Solutions (1)

Accepted Solutions (1)

former_member207877
Active Participant
0 Kudos

Hello Cheng,

Its better to handle all the phase change related codes in toolbar scripts.

Use below code in contract document template toolbar script

import com.sap.eso.api.contractgen.phase.PhaseIBeanHomeIfc;

import com.sap.eso.api.contractgen.TemplateContractIBeanHomeIfc;

sRETIRED= "Retired";

phaseHome = IBeanHomeLocator.lookup(session, PhaseIBeanHomeIfc.sHOME_NAME);

retiredPhase = phaseHome.findUniqueByDisplayName(sRETIRED);

cdTempHome = IBeanHomeLocator.lookup(session, TemplateContractIBeanHomeIfc.sHOME_NAME);

cdTempHome.upgradeToEdit(doc);

doc.setPhaseObjRef(retiredPhase.getLocalizedObjectReference());

cdTempHome.save(doc);

cdTempHome.downgradeToView(doc);

Regards,

Raj

Answers (0)