3

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?

1 Answer 1

2

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.

2
  • Thanks, I liked your expression "those funny objects". A trigger was my choice. Commented Feb 5, 2013 at 15:06
  • I believe its the technical term ;) Commented Feb 5, 2013 at 16:23

You must log in to answer this question.

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