[SalesForce] How to set a Predefined Field Value lookup field by ID

I created an Opportunity Action, using the OpportunityLineItem as the Target Object. I want to set a Predefined Field Value for the field PricebookEntryID. When I add a new predefined value, select the lookup field (Price Book Entry) and set the formula to '[some-pbe-id]', I end up with this error (which makes sense):

Error: Formula result is data type (Text), incompatible with expected data type (Lookup(Price Book Entry)).

How can we set an ID using the formula editor? I read that it is now possible in Winter14.

Source: http://docs.releasenotes.salesforce.com/he-il/winter14/release-notes/rn_186_chatter_new_mdp_predefined_field_types.htm

You can now predefine values for lookup and master-detail fields.

Thanks,

Best Answer

While lookup and master-detail fields are supported, this is only in terms of being able to reference a value from another field. So I have a scenario where an account can only have opportunities with a specific pricebook, so I have populated a lookup to the pricebook on the account object. I can then predefine the pricebook on a "new opportunity" publisher action with the following formula:

Account.Price_Book__c

Unfortunately you can't pass in the id of a specific record as a literal.

Related Topic