*This post is locked for comments
*This post is locked for comments
Hi Jason,
which library do we need to add first before adding OnChange event?
Thanks,
Ayadh
Can you please help on below error for the same subject
@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
OnScriptTagLoaded@192.168.0.11:5555/.../ClientApiWrapper.aspx
AppendScriptTag/scriptTag.onload/<@192.168.0.11:5555/.../ClientApiWrapper.aspx
This is great, thank you!
Works like a treat ...thanks. Shame about the product grid functionality
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"); }
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156