cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Organizational Unit of a Master Agreement?

Former Member
0 Kudos

HI,

I am trying to retrieve value of Organization Unit of a Master Agreement but I am getting some code: name.

ownerObj=doc.getDocumentOwnerUserReference();

ownerHome=IBeanHomeLocator.lookup(session,ownerObj);

ownerBean=ownerHome.find(ownerObj);

throw doc.createApplicationException("VENDOR_VISIBLE", "Supplier name is "+

ownerBean.getOrganization());

Please suggest.

Thanks,

Saloni

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I am able to get organizational unit of MA. I need Business unit of Contract Document.

If I write below code, its not working...

businessUnitObj=doc.getBusinessUnitObjRef();

businessUnitHome=IBeanHomeLocator.lookup(session,businessUnitObj);

businessUnitBean=businessUnitHome.find(businessUnitObj);

throw doc.createApplicationException(" ", "contract BU is "+

businessUnitBean.getDisplayName());

It gives error... method not found in contractDocumentBeanImpl...

please guide me to get through.

Thanks,

Saloni

Former Member
0 Kudos

Hi Solani,

You were getting the error beacuse we don't have any field like org unit in the Contract Document and the method you used is not there in the API's.If you want to access the Master Agreement Org unit in Contract document then you have to get the MA bean and then you can fetch Org unit in your contract document.

Code as follows:-

masterBean = doc.getParentIBean();// to get the MA bean

orgunit = masterBean.getOrganizationalUnitRef(); //this wil give the orunit of the MA

businessUnitHome=IBeanHomeLocator.lookup(session,orgunit);

businessUnitBean=businessUnitHome.find(orgunit);

Hope this will work for you.

Thanks,

Ankur Goyal

Edited by: ankur_goyal03 on Oct 15, 2011 8:23 AM

Former Member
0 Kudos

Hi Ankur,

This gives Organization Unit of Master Agreement. But I want Business Unit of Contract Document.

Any idea of the same.

Thanks,

Saloni

Former Member
0 Kudos

Hi Sonali,

I don't find that we have a business unit at the contract document level.It's maitained for the MA only.

Can you give me some more information about your requirement.

Thanks,

Ankur Goyal

Edited by: ankur_goyal03 on Oct 15, 2011 12:28 PM

Former Member
0 Kudos

Hi Ankur,

When we select a particular MA, and go to Contract Documents tab. There is list of all contract docs for that MA. If you click a particular contract name link. A information page opens. There you can find BU info.

Thanks,

Saloni

Former Member
0 Kudos

Hi Sonali,

we don't have a standard field as Business unit in the conract document , It would be a custome extension field.

You can fetch that extension field by using the following code:-

businessUnit=doc.getExtensionField("Field_Id").get();

Remember that you are writing the script for a contract document only.

Hope this should work.

Thanks,

Ankur Goyal

Former Member
0 Kudos

Hi Ankur,

Ok, I will try this. I think you are right that its extension field, so code you suggested should work.

Thanks,

Saloni

Former Member
0 Kudos

Hi Ankur,

I tried below code but it isnt working,

businessUnit = doc.getExtensionField("WF_BUS_UNIT").get();

The script class defined is "Master Agreement" as it shall trigger on Publish Date checkbox click event.

Please guide how to access extension fields of contract documents in Master Agreement class script?

Thanks,

Saloni

Former Member
0 Kudos

Hi Ankur,

I was able to retrieve value using contractbean.getExtensionField("Id").get( );

Thanks,

Saloni

Answers (0)