Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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.

Question:

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

share|improve this question

1 Answer 1

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

 
discard

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.