Thursday, May 5, 2011
Tuesday, April 26, 2011
Importing Solution to Another Organization Changes ObjectTypeCode
An issue came up yesterday regarding importing one organization's customizations (sitemap, isv.config, custom entities, etc.) into another. While the files imported successfully and everything appeared correct we quickly realized one crucial error we had assumed...
When importing a solution to another organization changes the ObjectTypeCode of every custom entity!
The ObjectTypeCode is the database equivalent of the ETC query string parameter. In simpler terms, any reference to the etc code in the URL of any custom entity will be in correct.
The issue it seems is that when importing, CRM ignores the ObjectTypeCode node in the customizations.xml and instead inserts them alphabetically instead.
So if you had an entity named new_account and it had an etc of say 10100 which typically means its the one hundredth custom entity created, it will now be 10000 since it is the first alphabetically.
So what's the solution?
Some workarounds mentioned around the web and in the msdn forums is to use the ObjectTypeName, abbreviated OTN. If you notice when crm generates the url for a custom entity it adds this as a query string parameter labeled objecttypename=new_account.
So by using this method you avoid using the etc and refer to the string equivalent. I have always assumed this etc number to carry over since its in the xml but its not.
Happy Coding!
When importing a solution to another organization changes the ObjectTypeCode of every custom entity!
The ObjectTypeCode is the database equivalent of the ETC query string parameter. In simpler terms, any reference to the etc code in the URL of any custom entity will be in correct.
The issue it seems is that when importing, CRM ignores the ObjectTypeCode node in the customizations.xml and instead inserts them alphabetically instead.
So if you had an entity named new_account and it had an etc of say 10100 which typically means its the one hundredth custom entity created, it will now be 10000 since it is the first alphabetically.
So what's the solution?
Some workarounds mentioned around the web and in the msdn forums is to use the ObjectTypeName, abbreviated OTN. If you notice when crm generates the url for a custom entity it adds this as a query string parameter labeled objecttypename=new_account.
So by using this method you avoid using the etc and refer to the string equivalent. I have always assumed this etc number to carry over since its in the xml but its not.
Happy Coding!
Tuesday, April 5, 2011
TechNet Online Documentation for MSCRM 2011
Link:
http://technet.microsoft.com/en-us/library/bb496811.aspx
The link above gives you access to the technet documentation.
The navigation to the left will allow to choose from the following:
The White Papers section currently only houses the Claims Based Authentication but will be expanded soon.
This is a valuable go to resource for any CRM developer!
Happy Coding!
http://technet.microsoft.com/en-us/library/bb496811.aspx
The link above gives you access to the technet documentation.
The navigation to the left will allow to choose from the following:
- Installation
- SDK
- White Papers
- Introduction
- Planning Guide
- Installing Guide
- Operating and Maintaining Guide
The White Papers section currently only houses the Claims Based Authentication but will be expanded soon.
This is a valuable go to resource for any CRM developer!
Happy Coding!
Thursday, December 9, 2010
ISVConfig/SiteMap Tip #1: Point to an ASPX page to extend functionality
So far it's been about 2 months since I've been working with the CRM 2011 Beta and while many things have changed drastically, the SiteMap and ISVConfig still adhere to the same rules as in CRM 4.
When creating a link for the Workplace I prefer to use an ASPX page as opposed to a JS page or otherwise. The reason I use it is not only can I embed JS I can also render my own webpages, silverlight controls, etc.
In a real world example, you are tasked with creating a link in the workplace that not only points to the Active View of the desired entity but also opens a new window that allows you to create an instance of that particular entity. I pointed my SiteMap to an ASPX page that simply ran JS onLoad:
<beginscript language="javascript" type="text/javascript">
//Open popup and set location using CRM global var
window.open('/' + parent.top.ORG_UNIQUE_NAME + '/userdefined/edit.aspx?etc=10002', null);
window.location.href = '/' + parent.top.ORG_UNIQUE_NAME + '/_root/homepage.aspx?etc=10002&pagemode=iframe';</endscript>
*Note: Replace the begin and endscript tags with script. Blogger apparently doesn't like that tag!
However if I needed some silverlight or a webpage I can easily modify the ASPX page outside of CRM and not have to worry about importing. Using this method provides me enough abstraction to pretty much do what I want.
Tips about the code above:
When creating a link for the Workplace I prefer to use an ASPX page as opposed to a JS page or otherwise. The reason I use it is not only can I embed JS I can also render my own webpages, silverlight controls, etc.
In a real world example, you are tasked with creating a link in the workplace that not only points to the Active View of the desired entity but also opens a new window that allows you to create an instance of that particular entity. I pointed my SiteMap to an ASPX page that simply ran JS onLoad:
<beginscript language="javascript" type="text/javascript">
//Open popup and set location using CRM global var
window.open('/' + parent.top.ORG_UNIQUE_NAME + '/userdefined/edit.aspx?etc=10002', null);
window.location.href = '/' + parent.top.ORG_UNIQUE_NAME + '/_root/homepage.aspx?etc=10002&pagemode=iframe';</endscript>
*Note: Replace the begin and endscript tags with script. Blogger apparently doesn't like that tag!
However if I needed some silverlight or a webpage I can easily modify the ASPX page outside of CRM and not have to worry about importing. Using this method provides me enough abstraction to pretty much do what I want.
Tips about the code above:
- Using the CRM provided JS variables helps out tremendously. Familiarize yourself with them!
- The pagemode=iframe parameter in the url will give you the correct view to show in the window.location. It removes the ribbon and anything else besides the core view.
Subscribe to:
Posts (Atom)