I am using Remote Object for Opportunity Product.I want to read Product2.Name but not able to define Product2 field in remoteobject type while it is standard field.My objective is to read Product2.Name from javascript.

   <apex:remoteObjects jsNamespace="RemoteObjectModel">
        <apex:remoteObjectModel name="OpportunityLineItem" fields="Id,OpportunityId,Product2">

I have tried Product,Product2,Product2.Name but all giving me error :

Save error: Invalid field 'OpportunityLineItem.Product2' specified. Ensure that you use the full API name for any custom fields.

  • Unfortunately, accessing parent objects, lookup, or child objects from a VisualForce Remote Object isn’t currently supported. I have to find another alternative.
    – unidha
    Commented Nov 3, 2016 at 8:09

1 Answer 1


Product2 is a readonly field, not an insertable field on OpportunityLineItems. You can use lookupfields, the previous comment is incorrect, I have done it.

You just have to use pricebookentryid, not Product2.

Opplineitems are very specific and you can get errors easily. You need OpporutunityId, Pricebookentryid, quantity, and Unit Price. Also the pbe has to be active, even if produt is active, if pbe is not active, you will get an error. This is important as most full sandboxes will not have all pb entries active.

I added the documention to this.


The ID of the related Product2 record. This is a read-only field available in API version 30.0 and later. Use the PricebookEntryId field instead, specifying the ID of the PricebookEntry record.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .