Converting to CRM 2011 JavaScript: The basics

I thought that I would outline some of the conversion techniques that we use in the CRM Migration Assistant to convert JavaScript from the CRM 4.0  object model to the CRM 2011 object model.

Many of the techniques we used in CRM 4.0 were technically unsupported.  But since work had to be done, we did stuff like that anyway.

As part of the migration process we actually convert many forms of unsupported, and supported, code into their supported CRM 2011 equivalents.

 

Here are a few of the basic conversions that you can do:

Tabs

CRM 4.0 CRM 2011
crmForm.all.tab0Tab
Xrm.Page.ui.tabs.get(0)
crmForm.all.tab1Tab
Xrm.Page.ui.tabs.get(1)
crmForm.all.tab2Tab
Xrm.Page.ui.tabs.get(2)
crmForm.all.tab3Tab
Xrm.Page.ui.tabs.get(3)
crmForm.all.tab4Tab
Xrm.Page.ui.tabs.get(4)
crmForm.all.tab5Tab
Xrm.Page.ui.tabs.get(5)
crmForm.all.tab6Tab
Xrm.Page.ui.tabs.get(6)
crmForm.all.tab7Tab
Xrm.Page.ui.tabs.get(7)

 

Global Variables and Methods

CRM 4.0 CRM 2011
ORG_LANGUAGE_CODE
Xrm.Page.context.getOrgLcid()
ORG_UNIQUE_NAME
Xrm.Page.context.getOrgUniqueName()
SERVER_URL
Xrm.Page.context.getServerUrl()
USER_LANGUAGE_CODE
Xrm.Page.context.getUserLcid()
GenerateAuthenticationHeader()
Xrm.Page.context.getAuthenticationHeader()

 

Form Properties and Methods

CRM 4.0 CRM 2011
crmForm.ObjectId
Xrm.Page.data.entity.getId()
crmForm.ObjectTypeName
Xrm.Page.data.entity.getEntityName()
crmForm.Save()
Xrm.Page.data.entity.save()
crmForm.SaveAndClose()
Xrm.Page.data.entity.save('SaveAndClose')
crmFormSubmit.crmFormSubmitId.value
Xrm.Page.data.entity.getId()

 

For more information on how the CRM Migration Assistant can help convert your JavaScript, visit our product page.

Leave a Reply 0 comments