- Toll Free: 1-866-SONOMA1
- Email Newsletter
- Blog
- YouTube
- Contact Us
Sonoma Partners
Client-side scripting in Microsoft CRM 3.0
Posted by Mike Snyder on October 24, 2005 |We could not be more excited about the new Software Development Kit (SDK) for Microsoft CRM 3.0. In addition to a greatly revamped server programming model, Microsoft CRM 3.0 now offers a strong client-side model to allow developers to tap into the following events:
- Form onLoad
- Form onSave
- Field onChange
By using these three client events to fire custom javascript code on the forms, the customizations possibilities in Microsoft CRM 3.0 expand exponentially. To help illustrate this, we posted an example of using the form onLoad event to alter field values before the user loads a form:
If you've worked with Microsoft CRM 1.2, you know that making this type of change would be either: 1. impossible or 2. involve totally hacking at the .aspx and javascript (which of course would not be supported by Microsoft). However, this customization code took us about 10 minutes using the Microsoft CRM 3.0 programming platform. Nice!
Please take a few minutes to review this example on our website, and let us know what you think!
Comments
Post a Comment
Contact Us for a Quote, or Personalized Demonstrationof Microsoft Dynamics CRM for Your Business.
Contact Us
Previous Post
Back to Blog
This is excellent news. Question though:
In the v1.2, the SDK did not have any comprehensive Javascript notes. How well is Javascript documented in the v3.0 SDK (I'd answer my own question, but for some (currently unknown) reason I'm having technical difficulty installing the new SDK... thanks!
--Dodd
Posted by: Dodd | Oct 24, 2005 1:46:53 PM
The CRM 3.0 SDK includes plenty of documentation on the client-side programming model, complete with some examples.
We'll post more examples on our website over the next few months so let us know if you have a specific request. Maybe we can accomodate you!
Posted by: Mike Snyder | Oct 25, 2005 7:11:08 AM
Any chance to post a phone number formatting code?
Posted by: Jason | Oct 28, 2005 8:02:55 PM
There's no need for us to post a phone number formatting code, Microsoft was kind enough to already include it in the Microsoft CRM 3.0 SDK!
// Get the field that fired the event.
var oField = event.srcElement;
// Validate the field information.
if (typeof(oField) != "undefined" && oField != null)
{
// Remove any nonnumeric characters.
var sTmp = oField.DataValue.replace(/[^0-9]/g, "");
// If the number has a valid length, format the number.
switch (sTmp.length)
{
case "4105551212".length:
oField.DataValue = "(" + sTmp.substr(0, 3) + ") " + sTmp.substr(3, 3) + "-" + sTmp.substr(6, 4);
break;
case "5551212".length:
oField.DataValue = sTmp.substr(0, 3) + "-" + sTmp.substr(3, 4);
break;
}
}
Posted by: Mike Snyder | Oct 28, 2005 9:26:43 PM