Welcome to MSDN Blogs Sign in | Join | Help

Fun with JScript and OnLoad

Microsoft CRM has always had the ability to use JScript on forms. In 1.x, you where limited to a subset of field types. In 3.0, all of the fields have the OnChange event (so if you change the value of the field, the script is triggered.) In addition, the actual CRM Form has two new events added for version 3.0. (OnLoad and OnSave)

Chris Regan wrote a very simple script that uses the OnLoad event to alert a user to the fact that the account they just opened up is on Credit Hold. To use this, open the forms designer. Then click on Form Properties.

Click on the OnLoad event type and click the Edit Button.

Click the Event Enabled box and type:

var oField = crmForm.all.creditonhold;

if (oField.DataValue)

{

 alert ("Alert! The Customer is on Credit Hold!")

}

Save all of the boxes and publish the changes.  So if you open the form, your user will be presented with the following.

This could get MUCH more complicated, but this gives you an idea of how you can help your customers using some of the new features in Microsoft CRM 3.0.  Enjoy!

Ben

Published Sunday, November 06, 2005 7:42 AM by Ben Vollmer
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Follow-up from Convergence 2007 Session

My apologies in not getting this up sooner. I flew home on the red-eye on Wednesday night, drove from

Friday, March 16, 2007 12:12 PM by East Region Microsoft CRM

# Follow-up from Convergence 2007 Session

My apologies in not getting this up sooner. I flew home on the red-eye on Wednesday night, drove from

Friday, March 16, 2007 1:22 PM by East Region Microsoft CRM

# College Fun Facts » East Region Microsoft CRM : Fun with JScript and OnLoad

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker