{"id":14988,"date":"2009-09-25T12:13:12","date_gmt":"2009-09-25T12:13:12","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/crm\/2009\/09\/25\/automating-field-updates\/"},"modified":"2023-05-31T15:36:58","modified_gmt":"2023-05-31T22:36:58","slug":"automating-field-updates","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/no-audience\/2009\/09\/25\/automating-field-updates\/","title":{"rendered":"Automating Field Updates"},"content":{"rendered":"

Today our guest blogger is CRM MVP <\/em>Donna Edwards<\/em><\/a>. Donna is also a moderator on the <\/em>Microsoft Dynamics CRM forums<\/em><\/a> where she can often be found answering questions and providing professional advice.<\/em><\/p>\n

Here is a simple way to calculate the value of a field based on the values of two other fields on a form using JavaScript.  The value of the field is updated whenever the value of one of the two other fields is changed.<\/p>\n

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.<\/p>\n