Skip to main content



No record found.

Microsoft Dynamics CRM forum
Suggested answer

Line Item Discount by Percentage for Quotes

Posted on by 57
It seems the default for discounting in quotes is fixed dollar amount versus percent discount... I really don't understand this as Microsoft is trying to compete with and the others who all allow percent discount by line by default. When we resell products, it is all based on discount percentages... not dollar amounts... I am not even sure what kind of business would work that way but certainly not integrators, VARS, and resellers. Worse... it doesn't seem there is an easy way to fix this. Any ideas?
  • Ayadh Shakoor Profile Picture
    Ayadh Shakoor 5 on at
    RE: Line Item Discount by Percentage for Quotes

    Hi Jason,

    which library do we need to add first before adding OnChange event?



  • Fasil Muhammed Profile Picture
    Fasil Muhammed 55 on at
    RE: Line Item Discount by Percentage for Quotes

    Can you please help on below error for the same subject

    @ line 157 > eval:1:1

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Line Item Discount by Percentage for Quotes

    This is great, thank you!

  • Zazen Profile Picture
    Zazen 185 on at
    RE: Line Item Discount by Percentage for Quotes

    Works like a treat ...thanks. Shame about the product grid functionality

  • Suggested answer
    jlattimer Profile Picture
    jlattimer 24,554 on at
    RE: Line Item Discount by Percentage for Quotes

    Here is an idea (it make need a little effort to make it fully work) - *Note this won't work with the editable product grid functionality

    On your line item records, create a new decimal field (allows 0 -100) for the line's discount percent.

    Add it to the form, make the existing Manual Discount field read-only but keep it on the form.

    Add some JavaScript on the OnChange event of the new Discount Percent field to figure discount amount automatically and place the result in the manual discount field. Once the record it saved the built in calculations should still work as expected.

    JavaScript would be similar to this:

    function DiscountPercent_OnChange() {
        var discPer = Xrm.Page.getAttribute("new_discountpercent").getValue();
    	if (discPer === null || discPer === undefined) {
    	else {
    		var manDisc = (Xrm.Page.getAttribute("priceperunit").getValue() * Xrm.Page.getAttribute("quantity").getValue()) *
    			(discPer / 100);

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,459 Super User

Martin Dráb Profile Picture

Martin Dráb 225,783 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans