Converting to CRM 2011 JavaScript: Unsupported Internal Functions and Properties

I’ve seen a lot of CRM 4.0 JavaScript over the past year and a half as I work on my JavaScript conversion tool: CRM Migration Assistant.

A lot of us used unsupported customizations to create a user experience that fit the needs of the customer.  Sometimes these customizations were very unsupported and used internal functions or crmForm properties to accomplish a task. 

Here are some examples:

 

// CRM 4.0
var id = crmFormSubmit.crmFormSubmitId.value;

// CRM 2011
var id = Xrm.Page.data.entity.getId();

Luckily, this piece of code can convert to a CRM 2011 equivalent, as you can see above.  Other usages are not so lucky:

 

// CRM 4.0 
var value = crmFormSubmit.crmFormSubmitSecurity.value;
var value = crmFormSubmit.crmFormSubmitObjectType.value;
crmNavBar.style.display = "none";
mnuBar1.style.display = "none";
lookupItem[0] = new LookupControlItem("{3A6C1B06-C62F-DC11-AFC2-0019B9B20373}", 1022, "Default Price List");

 

These examples do not have a CRM 2011 equivalent so you will be forced to rewrite any instances of this type of code.

 

The CRM Migration Assistant inserts a conversion warning when it encounters an internal CRM function or property, but it is up to the developer to correct the code manually.

2 Comments
  1. Where can I find examples of how to rewrite code such as LookupControlItem, which does not convert to a CRM 2011 equivalent?

Leave a Reply