Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a classic Invoice by using Custom Object

  • Invoice (Master)

  • Invoice Line Item (Detail)

Invoice_Line_Item should have a look up relationship with Product. Also it has to include Quantity, Total (formula) and Unit Price (the selected product standard price).

I've trying using formula and look up type for unit price. But I wasn't able to referral that Product property.


There exist any way to use Product standard price in a custom object?

share|improve this question
up vote 2 down vote accepted

Unit Price, unless a custom field, is not a field available on the Product object. In order to achieve what I think you are after I think you would have to revert to code either as part of a custom controller or a trigger.

I think you would need to query the PricebookEntry object:

   Select p.UnitPrice, p.Product2.Name, p.Product2.Id, p.Product2Id, 
   p.Pricebook2.IsStandard, p.Pricebook2Id From PricebookEntry p
   where p.Pricebook2.IsStandard = true
   and p.Product2Id = :someProductId

Unfortunately, you can't create a lookup directly to PricebookEntry as it's one of those 'funny' objects.

share|improve this answer
Thanks, I liked your expression "those funny objects". A trigger was my choice. – Martin Borthiry Feb 5 '13 at 15:06
I believe its the technical term ;) – Phil Hawthorn Feb 5 '13 at 16:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.