Category Archives for "Conversion Strategies"

4 JavaScript Upgrade Strategy #5: Web Resource Organization

When designing or re-designing JavaScript Web Resources, there are a few practices that I like to follow:   One web resource per entity Create one resource for each entity. This resource will contain JavaScript functionality related specifically to that entity.   One web resource per entity ribbon If you have JavaScript called from Ribbon configuration […]

Continue reading

1 JavaScript Upgrade Strategy #3: Use Visual Studio (with add-ins)

One of the best practices a Dynamics CRM developer can follow is to use Visual Studio to edit your JavaScript.  Combine the basic functionality with an add-in like Resharper, and you have a very productive development environment.  Here’s why: Intellisense Visual Studio provides both intellisense and the ability to visually identify coding errors. This alone […]

Continue reading

JavaScript Upgrade Gotcha #2: Using the JavaScript eval method

The use of the JavaScript method eval is considered to be bad coding practice by most of the JavaScript Technorati. That doesn’t stop people from using it, and it makes automatic conversion verify difficult. Consider this code:   this.FieldName1 = "name"; eval(‘this.Field1 = crmForm.all.’ + this.FieldName1);   While I will not debate the merits of […]

Continue reading

1 JavaScript Upgrade Gotcha #1: The .id property

Consider this code segment: var oField = executionObj.getEventSource(); if (oField.id == “new_field1” || oField.id == “new_field2”) { // do something } This uses the JavaScript .id property to retrieve the field name. Since this type of code can represent both form controls as well as data items (from SOAP or REST calls), it would be […]

Continue reading

JavaScript Upgrade Strategies webinar follow-up

The recording today’s webinar is now up: http://www.xrmvirtual.com/events/javascript_upgrade_crm2011_Mitch_Milam Here are the main talking points from today’s meeting: Strategies: Here are the strategies I follow when performing an upgrade from CRM 4.0 to CRM 2011: #1: Create a test environment #2: Upgrade your object model #3: Use Visual Studio (with add-ins) #4: Reorganize your functions #5: […]

Continue reading

JavaScript Conversion: Creating a supported LookupControlItem method

In Dynamics CRM 4.0, you could use an unsupported internal function to create the value to be inserted into a Lookup control.  The code would look something like this: var lookupItem = new Array(); lookupItem[0] = new LookupControlItem(“{3A6C1B06-C62F-DC11-AFC2-0019B9B20373}”, 1, “A Sales Store 3”); crmForm.all.pricelevelid.DataValue = lookupItem;   This function still exists in Dynamics CRM 2011 […]

Continue reading

JavaScript Conversion: Removing unnecessary code #1. Adding mailto to an email-enable text field

Occasionally I will run into JavaScript that was added to a form to provide functionality desirable by the business. I have seen several instances where code such as this:   if (crmForm.all.emailaddress1 != null) { crmForm.all.emailaddress1.ondblclick = function () { var email = crmForm.all.emailaddress1.DataValue; if ((email != null) && (email.length > 0)) { window.navigate(“mailto:” + […]

Continue reading

JavaScript Conversion: Handling Automatic Semicolon Insertion

One of the most difficult parts of converting JavaScript from CRM 4.0 to 2011 is handling situations where the developer did not use a terminating semicolon.  Actually, this is a problem with JavaScript in general, as I was reminded this week when I listened to the Drama episode of the This Developer’s Life podcast.  That […]

Continue reading

3 JavaScript Conversion Discussions Webinar Recording and Materials

JavaScript Conversion Discussions Webinar (September, 2012) We’ll discussed the technical aspects of converting your JavaScript from CRM 4.0 to CRM 2011, as well as the processes that will aid in the overall upgrade process.   Tools to Help Your Conversion: JavaScript Converter http://dynamicsxrmtools.codeplex.com   CRM JavaScript Conversion Assistant http://www.crmaccelerators.net/products/crm-migration-assistant-2   CRM Code Validation Tool http://blogs.msdn.com/b/crm/archive/2012/06/21/microsoft-dynamics-crm-2011-custom-code-validation-tool-released.aspx   […]

Continue reading