function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ARanjanARanjan 

Need help in formula on quote line item

Hi

 

I am trying to create formula to calculate discount  ((ListPrice - UnitPrice ) / ListPrice) * 100 on quote line item.

I can see ListPrice read only field is there on quote line item still I am getting error ListPrice field does not exist.

 

Or

Is there any waty I can bring discount amount from opportunity line item.

 

Thanks,

Best Answer chosen by Admin (Salesforce Developers) 
MellowRenMellowRen

This may work:

 

(( PricebookEntry.UnitPrice - UnitPrice ) / PricebookEntry.UnitPrice ) * 100

 

Regards

MellowRen

All Answers

MellowRenMellowRen

This may work:

 

(( PricebookEntry.UnitPrice - UnitPrice ) / PricebookEntry.UnitPrice ) * 100

 

Regards

MellowRen

This was selected as the best answer
ARanjanARanjan
Awesome Thanks a lot !

--
*Archana Ranjan*
Salesforce Administrator

Ph: +91 8605017604
Skype ID: enterprisedb_archana.ranjan
www.enterprisedb.com
*
Follow us on Twitter*
@EnterpriseDB

Visit EnterpriseDB for tutorials, webinars,
whitepapersand
more
Denis Augusto ValenteDenis Augusto Valente
As this post is 2 years old, I'm just writing for future references that search for a solution for ListPrice field on QuoteLineItem. 

I think that this solution can cause a problem, in future. As exposed, it work fine if you do not change the prices on your pricebooks. If you change the price on you price list your field on Quote Line Item will be updated. 

If you reference your formula on PriceBookEntry and the value is changed on your pricelist, all legacy quotes will be recalculated. As the field is inaccessible by a formula (I think that it's a bug because you can reference the field ListPrice on OpportunityLineItem), then I suggest to create a new field on QuoteLineItem and record in this field the same value that is recorded in ListPrice. You can do it using a workflow, a flow created by process builder or a trigger. 

Steps:
Create a field ListPrice on QuoteLineItem;
Create a workflow with a field update action, where you update QuoteLineItem.ListPrice__c = PricebookEntry.UnitPrice

In this way, you can refer the field ON QuoteLineItem object, instead you refer directly to PriceBookEntry. In this case, you can update your price book and the values will be kept on Opportuniy Line Item objetct. 
Michael Robert 19Michael Robert 19
Thanks Denis,
  I'm surprised more people haven't complained of this one.  I've been researching this and your solution is the best I've found so far.
  Can't understand why Salesforce makes that field hidden.