Answered by:
Open the Url form of an entity record by JavaScript

Question
-
Hi All,
I create a function that open an entity form for existing record. the fonction is the folowing:
What is the the Dymanic part of the URL from environnement to another.I want a generique code to open any entity record form any environnement
Thanks for Help
Monday, August 8, 2011 10:56 AM
Answers
-
Hi,
Few points:
1. You should use etn (entity type name) instead of using etc (entity type code), etc code can change everytime you deploy entity from one enviornment to another.
Updated:
2. Why are you hardcoding rskey value?, you should remove it because it CRM generates it automatically based on opening record from the Entity Grid View (this value is used for Record Navigation in Form)
3. Also make sure that your Url includes he organization name
You may reffer to the following URL for further details: http://msdn.microsoft.com/en-us/library/gg328483.aspx
Jehanzeb Javeed
http://worldofdynamics.blogspot.com
Linked-In Profile |CodePlex Profile
If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
- Edited by Jehanzeb.Javeed Monday, August 8, 2011 11:06 AM Upadate Notes
- Proposed as answer by Jehanzeb.Javeed Monday, August 8, 2011 11:08 AM
- Marked as answer by BERKAYA Hedi Monday, August 8, 2011 11:43 AM
Monday, August 8, 2011 11:04 AM -
Jehanzeb is correct that etn should be used because entity type code can be different for custom entities across systems, but if you pull up an entity in CRM you will notice that etc is included in the querystring by default, but you can change it to be etn= instead of etc=. Then you just put the name of the entity. So you will need to still parse in the name of the entity and the GUID for any operation that will generate an entity record.
Example, I hightlighted the GUID and entity name for you.
https://sogeti3.crm.dynamics.com/main.aspx?etn=account&extraqs=%3f_gridType%3d1%26etc%3d1%26id%3d%257bF529F7E6-ADC1-E011-8D7C-1CC1DE79838E%257d%26rskey%3d424843320&pagetype=entityrecord
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Proposed as answer by Jamie MileyModerator Monday, August 8, 2011 11:10 AM
- Marked as answer by BERKAYA Hedi Monday, August 8, 2011 11:43 AM
Monday, August 8, 2011 11:10 AMModerator
All replies
-
Hi,
Few points:
1. You should use etn (entity type name) instead of using etc (entity type code), etc code can change everytime you deploy entity from one enviornment to another.
Updated:
2. Why are you hardcoding rskey value?, you should remove it because it CRM generates it automatically based on opening record from the Entity Grid View (this value is used for Record Navigation in Form)
3. Also make sure that your Url includes he organization name
You may reffer to the following URL for further details: http://msdn.microsoft.com/en-us/library/gg328483.aspx
Jehanzeb Javeed
http://worldofdynamics.blogspot.com
Linked-In Profile |CodePlex Profile
If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
- Edited by Jehanzeb.Javeed Monday, August 8, 2011 11:06 AM Upadate Notes
- Proposed as answer by Jehanzeb.Javeed Monday, August 8, 2011 11:08 AM
- Marked as answer by BERKAYA Hedi Monday, August 8, 2011 11:43 AM
Monday, August 8, 2011 11:04 AM -
Jehanzeb is correct that etn should be used because entity type code can be different for custom entities across systems, but if you pull up an entity in CRM you will notice that etc is included in the querystring by default, but you can change it to be etn= instead of etc=. Then you just put the name of the entity. So you will need to still parse in the name of the entity and the GUID for any operation that will generate an entity record.
Example, I hightlighted the GUID and entity name for you.
https://sogeti3.crm.dynamics.com/main.aspx?etn=account&extraqs=%3f_gridType%3d1%26etc%3d1%26id%3d%257bF529F7E6-ADC1-E011-8D7C-1CC1DE79838E%257d%26rskey%3d424843320&pagetype=entityrecord
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Proposed as answer by Jamie MileyModerator Monday, August 8, 2011 11:10 AM
- Marked as answer by BERKAYA Hedi Monday, August 8, 2011 11:43 AM
Monday, August 8, 2011 11:10 AMModerator