on 10-07-2011 1:22 PM
Hello,
I am trying to retrieve value of "Date of Publish" field, please let me know what syntax is used for the same.
Thanks,
Saloni
Hi,
I am using below code to get values of DATE_TO_PUBLISH_DATE and CONTACT_EMAIL, but I am getting null output although there are values set in these fields. Here, publish date is date for publish to supplier and contact email is vendors mail id.
Can you suggest if anything is missing?
publish_date = doc.getExtensionField("DATE_TO_PUBLISH_DATE");
vendor_email = doc.getExtensionField("CONTACT_EMAIL");
Please suggest.
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,
Only extension fields can be accesed by doc.getExtensionField(..).
Standard fields can be accessed by the respective getter methods (e.g. getPublishDate()). If you don't see a simillar method exposed you should ask SAP for this through an OSS message giving some background aroudn your requirement.
You can use a generic getter "get("Attribute_Name") "method to access standard fields ONLY if SAP confirms this field will be exposed as a fix . Plese note you have a risk of using generic getters for unexposed fields.
Thanks,
Baski
Hi Baski,
I needed to get values of Vendor_Visible, Date_To_Publish_Date and Email.
As per your last reply, I checked in Setup--> Extension Definitions List. But these fields are not defined there. Although I am able to get value of Vendor_Visible using getExtensionField("Vendor_Visible") but not other two values.
Please confirm how we get to know whether a field is extension field or not.
Thanks,
Saloni
Hi,
As long as you don't define extension fields explicitly during customization, you won't have any extension fields. All the fields that are delivered are standard fields.
Coming to the question,
In the scenario explained, not sure how you a standard field value(Vendor_Visible) could be accessed through "doc.getExtensionField()". . I seriously doubt that.. Please check. as this a boolean field, you may get FALSE all the time..
In the IAPI document if you see any specifc methods for these variables, you may have to request SAP through an OSS message.
Thanks, Baski
Hi,
Ok, I will try doing by defining extension fields as well.
While going through IAPI, I found the below methods
getPublishDate()
getPublishToVendor()
getVendorContactEmail()
But when I tried
doc.getPublishDate(), the following error was displayed,
Sourced file: inline evaluation of: ``import com.sap.odp.api.util.; import java.util.; import javax.mail.; import j . . . '' : Error in method invocation: No args method getPublishDate() not found in class'com.frictionless.api.contracts.ContractIBeanImpl'*
Do you have any idea whether what is missing?
Thanks,
Saloni
Hi Baski,
When I tried to retrieve vendor_visible and date_to_publish using getExtensionField(" ") method, its working fine. But I am still not able to get value for Primary Contact Email on Supplier Info tab.
I am doubtful what is the attribute name we pass for EMAIL address on supplier info tab?
From where can we check this attribute name, as using database column name is not working?
Thanks,
Saloni
Hi Devesh,
I tried running the below script but it didnt work.
Can you please check if I am missing something?
linkDefnHome = IBeanHomeLocator.lookup(session,DocumentLinkDefinitionIBeanHomeIfc.sHOME_NAME);
linkDefn = linkDefnHome.findUnique("FCI_MAS_CONTACT");
vendorEmail=linkDefn.getEmail();
throw doc.createApplicationException("VENDOR_VISIBLE", "Supplier Emailis "+vendorEmail);
Also, tried below but not working.
vendorEmail=linkDefn.getBuyerContactEmail();
Please suggest.
Thanks,
Saloni
Hi Devesh,
In IBean Management, we need to obtain the bean object using below code. But I am not sure what is Unique Document Identifier for VendorIbeanIFC or ContactIBeanIFC.
Can you help with the same.
linkDefnHome = IBeanHomeLocator.lookup(session, DocumentLinkDefinitionIBeanHomeIfc.sHOME_NAME);
// Find by Unique Document Identifier
//
linkDefn = linkDefnHome.findUnique("Unique document Identifier");
Thanks,
Saloni
Hello,
You can use the code below to get the email :
vendorHome = IBeanHomeLocator.lookup(session,VendorIBeanHomeIfc.sHOME_NAME);
vendorBean = vendorHome.find(doc.getVendorRef());
email = vendorBean.getBuyerContactEmail();
Don't forget the necessary imports.
I hope this ends your confusion.
Thanks
Devesh
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.