web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Line Item Discount % for Quotes in CRM 2016

(0) ShareShare
ReportReport
Posted on by 55

Hi,

I got the below Tips from CRM Community,

https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/124012/line-item-discount-by-percentage-for-quotes/1005916#1005916

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) {
		Xrm.Page.getAttribute("manualdiscountamount").setValue(0);
	}
	else {
		var manDisc = (Xrm.Page.getAttribute("priceperunit").getValue() * Xrm.Page.getAttribute("quantity").getValue()) *
			(discPer / 100);
		Xrm.Page.getAttribute("manualdiscountamount").setValue(manDisc);
	}
	Xrm.Page.getAttribute("manualdiscountamount").setSubmitMode("always");


But the below error faced when it is running. Please advise

@192.168.0.11:5555/.../ClientApiWrapper.aspx line 157 > eval:1:1
RunHandlerInternal@192.168.0.11:5555/.../ClientApiWrapper.aspx
RunHandlers@192.168.0.11:5555/.../ClientApiWrapper.aspx
ExecuteHandler@192.168.0.11:5555/.../ClientApiWrapper.aspx
$Cj_1@192.168.0.11:5555/.../formcontrols.js
executeHandler@192.168.0.11:5555/.../formcontrols.js
executeHandlerByDescriptor@192.168.0.11:5555/.../formcontrols.js
getHandler/<@192.168.0.11:5555/.../formcontrols.js
getHandler/<@192.168.0.11:5555/.../global.ashx
fireOnChange@192.168.0.11:5555/.../formcontrols.js
setValueInternal@192.168.0.11:5555/.../formcontrols.js
setValue@192.168.0.11:5555/.../formcontrols.js
$3e_2@192.168.0.11:5555/.../formcontrols.js
Function.createDelegate/<@192.168.0.11:5555/.../MicrosoftAjax.js
b@192.168.0.11:5555/.../MicrosoftAjax.js

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 107 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 92

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans