cancel
Showing results for 
Search instead for 
Did you mean: 

Beanshell script for updating owner of Contract & MA Templates specifically (rather than docs)

Former Member
0 Kudos

Experts-

I'd like to update the owner on Contract Generation Templates (Templates, Sections, & Clauses) and Master Agreement Templates.

Looking at the IAPI docs, I'm not sure which IBeam interface these are exposed in.  I don't necessarily need code samples or anything, just a little guidance.. My questions are in blue.  

Some possibilities I found:

The method:  setOwnerObjRef(ObjectReferenceIfc value) of these objects:

com.sap.eso.api.contractgen

TemplateContractIBeanIfc

- Is this just for Contract Gen "templates"?  If so, how do you get or can you also access Sections and Clauses too?

I'm thinking may have to check the parent doc on the ClauseIBeanIfc and SectionIBeanIfc.

ClauseIBeanIfc

SectionIBeanIfc

com.sap.eso.api.contracts

ContractIBeanIfc

- This has a field called isTemplate.  What does it mean when this is TRUE?  That it's a Master Agreement Template?

  

Or perhaps you know of a better way?

Thanks in advance!

Mike

PS

I started thinking about this after seeing Joerg Lippmann's blog post: and the discussion he references in the article.

Accepted Solutions (1)

Accepted Solutions (1)

former_member207877
Active Participant
0 Kudos

Hello Michael,

For setting the Contract document template owner you can use the below Script.

Also if you are the owner of Contract document Template obviously you will be having access to the Sections and clauses.

//for setting the Owner of the Contract document templates ( ex:- CD Temp 1)

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

import com.sap.odp.api.common.platform.IapiAccountIfc;

import com.sap.odp.api.common.platform.IapiSessionContextIfc;

//getting the user reference

userObj= session.getAccount().getAccountObjectReference();

//Setting the Owner with above reference

doc.setDocumentOwnerUserReference(userObj);

If you want to replace for the clauses and sections in CD Temp ,  then create home for the respective clauses and sections and then use below script

//For Sections and Clauses

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

//Setting the Owner with above reference

doc.setOwnerObjRef(userObj);

For Setting the Master Agreement Template Owner it is same as Master Agreement since they are of same class 1004

//for master agreement templates

import com.sap.eso.api.contracts.ContractIBeanIfc;

//Setting the Owner with above reference

doc.setDocumentOwnerUserReference(userObj);

Note: If you are writing Script in the respective class, then Doc can be referred as bean otherwise Home has to be created for the class and then you have to access the methods from respective Bean

Hope this helps!

Regards,

Raj

Former Member
0 Kudos

Raj-

This looks like exactly what I was looking for.  I really appreciate it!

Mike

former_member207877
Active Participant
0 Kudos

Anytime Mike

Regards,

Raj

Answers (0)