Today our guest blogger is CRM MVP Donna Edwards. Donna is also a moderator on the Microsoft Dynamics CRM forums where she can often be found answering questions and providing professional advice.
For this example, I will use the Opportunity form. The request is to add a custom field that shows the Total Value of the Opportunity after Discount. I will use the following fields for reference in the example.
Steps to implement the change:
The end result will be that whenever the Total_Discount or Est. Booking field is updated the Total_Estimated_Value will update by subtracting the Total_Discount from the Est. Booking amount.
Please note that this example assumes there is always a value in the Est. Booking and Discount field when one of those fields are updated. You may have to add some additional code that first checks to see if there is a value in the Total_Discount and Est. Booking field before firing the "crmForm.all.Total_Estimated_Value.FireOnChange();" script. If there is no value (null), then you will have to set the value to 0 (zero). Checking and setting the default value of the fields to 0 can be done in the Form properties OnLoad event.