on 10-14-2011 1:25 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.