Home > onload event

Do you want a drop down box for the state, but you don’t want to break core CRM functionality?

In CRM 4.0 I had posted an article about changing the CRM Address State to a drop down box. I have went back and updated the code a little (fixed a bug) and it will work with CRM 2011.

Ok, this script uses the same methods I used in CRM 4 to show the states for the United States and Canada (You can always modify it to have more options). This will help restrict what people put in the state field by providing them a drop down box. It will also allow them to view the old text box and enter any custom information just by clicking on ‘* ENTER A CUSTOM PROVINCE *’.

This script will work on the onload for a lead, contact, account, and sales-contact.

Click to continue reading
Click Here To View Post With Syntax Highlighting

Visibility.js provides a simple way to set the visibility of navigation, section, tab, and form control elements using JScript. It also allows you to change the visibility using the onClick event of a checkbox.

Click to continue reading
Click Here To View Post With Syntax Highlighting

Need to reference an external javascript file to make functions available in change events and in an onload? Here’s how!

Click to continue reading
Click Here To View Post With Syntax Highlighting

In response to Peter Bergman’s post on the CRM forums, I traversed Microsoft’s code. I determined that the ApplyTemplate loads a specific page, and on that page, the ok button sets the information on the calling page. I melded the ApplyTemplate and ok methods together to create LoadTemplate provided below. With the right parameters, it will set the default template.

Click to continue reading
Click Here To View Post With Syntax Highlighting

In my previous post about hiding fields and tabs using roles, I outlined how use roles to hide fields, etc. Here is a modification of the method to hide sections by business unit.

Click to continue reading
Click Here To View Post With Syntax Highlighting

Do you need to hide fields or tabs based on security roles. Here is an easy way to add the functionality to your CRM, use my code example.

Click to continue reading
Click Here To View Post With Syntax Highlighting

Sometimes you need to be able to have preset values, and have the duration auto-update. In this example, I will make the actual durations auto-update when one of the fields is changed. If the duration is changed, then the end date will be changed.

Click to continue reading
Click Here To View Post With Syntax Highlighting

This script can be used to create a form in CRM that has fields appear based on a a radio (bit) yes/no. If yes, answer an additional question, if no, keep the other field hidden.

Click to continue reading
Click Here To View Post With Syntax Highlighting

© 2011 MSCRM Blogger

This site does not necessarily represent the views of Microsoft. The material posted on this blog are provided AS-IS, and you are to use the content at your own risk. Some of the code and information on this site may use unsupported methods. If you experience any problems using the information provided through this website, please post a comment and we will do our best to assist you, however, we can in no way guarantee support or resolution.

Microsoft Dynamics®, Silverlight®, Visual Studio®, and the corresponding logos are a registered trademarks owned by Microsoft Corporation. MSCRM Blogger has made every effort to supply trademark information about company names, products, and services mentioned on this blog. All third party trademarks are the property of their respective owners. Any rights not expressly granted herein are reserved.