Why isn't OrderProduct TotalPrice standard field available in formula merge field list
I took a look and couldn't see it either. I did a bit of research in the Spring '14 release notes and nothing there referenced why a field like that wouldn't be available. TotalPrice
appears to be a formula itself, combining Quantity
x UnitPrice
. Interestingly enough, there appears to be two sets of documentation available for OrderItem
as well (http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_orderitem.htm & http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_objects_orderitem.htm), neither of which have TotalPrice
listed as a field. EDIT: Peter Knolle did find it in Salesforce Help
At this point, my guess is that this is some sort of bug. I looked at their open/known issues related to order and didn't see anything. My suggestion would be to open up a case and see what Salesforce says. There may be something weird about TotalPrice
that isn't obvious that is preventing it from being listed. Unfortunately, there isn't a ton of documentation surrounding it just yet.
Salesforce has gotten back to me regarding this issue. They are reporting this as a known issue. The details of this issue are below and the link to the issuse is: https://success.salesforce.com/issues_view?id=a1p30000000T3UnAAK
Field Updates on Custom Currency Fields using OpportunityProducts.TotalPrice in Formula not Triggered as Expected
Workflow
Last updated 28 days ago ·Reference W-1060096 ·Reported By 0 users
IN REVIEW
Summary
When multiple workflow Field Updates exist on the Opportunity Products object that reference the "Total Price" field, some updates may be skipped.
Repro
1. Create a custom Currency field on Opportunity Products.
2. Create a workflow Field Update that updates the custom field to a constant value, such as 55.
3. Create a second Field Update that updates the custom field using a formula that returns the value of OpportunityProduct.TotalPrice.
Workaround
The current workaround is to replace the reference to the "TotalPrice" field with its calculation: "UnitPrice * Quantity".
Just received confirmation from Salesforce that:
The "TotalPrice" field is calculated dynamically via the UI and only exists when the UI displays the product records. Hence it can't be used in formula fields or other areas (like workflow). This calculation is not exposed at the API or Apex level. The "TotalPrice" is the units*price so that should be used in place of "TotalPrice".
I've been working with the new Order and Order Product (or OrderItem) objects, and I've noticed some inconsistencies.
My process was to use Workbench (workbench.developerforce.com/login.php) to explore the fields that actually reside on these objects (particularly OrderItem), because the fields that show in the 'customize object' subsection of Setup don't appear to be totally accurate.
I got several errors referencing fields that were appearing in the 'fields' listing from Apex. I'm not sure what's happening on SFDC's side, but it looks like Workbench has the most up-to-date field listing.
EDIT:
For whatever reason, several Order and OrderItem fields default to 'not visible' so they won't appear on Workbench when they're on the fields listing. The fields need to be individually whitelisted at the profile level (why?!).
See: