Friday, January 28, 2011

MSCRM: Calculated Fields Made Easy

Suppose you have money fields (Tuition, Room Cost, Dining Cost) on a screen that need to be totalled and the Total is also displayed on the. Screen. To accomplish this, you could put code like the following in the onChange events of each of the three data entry fields (tuition, room and dining):

crmForm.all.new_total.DataValue =
crmForm.all.new_tuition.DataValue +
crmForm.all.new_room.DataValue +
crmForm.all.new_dining.DataValue;

That gets a little tedious, however, and especially if you have many data entry fields contributing to the sum and you then have to add an additional field, requiring you to add the onChange event code to your new field plus all the others! So instead you could place the calculation code (the previous snippet) behind the onChange event of the calculated field (in this case, Total), and put the following, never-changing snippet behind every data entry field contributing to the calculated field:

crmForm.all.new_total.FireOnChange();

If you do it like this, you only have to update one script. This is a much better way!

5 comments:

Microsoft Dynamics AX training in Hyderabad said...

Microsoft Dynamics AX training, do keep a few things in mind to get the maximum out of the course as well as the application.we teach Microsoft Dynamics AX training and class at Hyderabad.

Microsoft Dynamics AX training in Hyderabad
Microsoft Dynamics CRM training in Hyderabad
Microsoft Dynamics NAV training in Hyderabad
Microsoft Dynamics AX online training
Microsoft Dynamics CRM online training
Microsoft Dynamics NAV online training

Microsoft Dynamics CRM training in Hyderabad said...

Microsoft Dynamics CRM training will help you manage and prioritize your business goals, customize.we teach MS Dynamics CRM training and class available at Hyderabad.

Microsoft Dynamics AX online training
Microsoft Dynamics CRM online training
Microsoft Dynamics NAV online training

Microsoft Dynamics NAV training in Hyderabad said...

Microsoft Dynamics NAV training could be a lifelong asset for your role in a small or medium enterprise.NAV Technical, NAV Trade, NAV Finance.we teach Microsoft Dynamics NAV training and class available at Hyderabad

Microsoft Dynamics AX training in Hyderabad
Microsoft Dynamics CRM training in Hyderabad
Microsoft Dynamics NAV training in Hyderabad

Anonymous said...

excellent piece of information, I had come to know about your website from my friend kishore, pune,i have read atleast 8 posts of yours by now, and let me tell you, your site gives the best and the most interesting information. This is just the kind of information that i had been looking for, i'm already your rss reader now and i would regularly watch out for the new posts, once again hats off to you! Thanx a lot once again, Regards, obiee training in hyderebad

Skill Quotient said...

Thanks for information.find the information Dynamics AX Online Training|Microsoft Dynamics CRM Training|Sharepoint Online Training