Answered by:
CRM 2011 - Javascript Conversion to CRM 2011 Syntex

Question
-
Hi All,
How to convert following CRM 4.0 Javascripts in to CRM 2011 syntex.
1. crmForm.all.new_projectid.AddParam("ShowNewButton", "0");
2. crmForm.all.new_partyid.additionalparams = 'search=' + searchValue;
3. var ParentForm = window.opener.parent.document.crmForm.all
Thank you all for your help - CRM Thirsty
- Edited by CRM Thirsty Friday, September 2, 2011 5:58 AM
Friday, September 2, 2011 3:31 AM
Answers
-
Try this tool.
http://crm2011scriptconvert.codeplex.com/
I hope this helps.
Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/- Proposed as answer by Amreek Singh Friday, September 2, 2011 5:15 AM
- Marked as answer by CRM Thirsty Friday, September 2, 2011 5:57 AM
Friday, September 2, 2011 5:15 AM -
Or, http://blogs.infinite-x.net/2011/07/30/crm-migration-assistant-1-2-released/
Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.- Marked as answer by CRM Thirsty Friday, September 2, 2011 5:57 AM
Friday, September 2, 2011 5:31 AMModerator -
- Marked as answer by CRM Thirsty Sunday, September 4, 2011 10:13 PM
Friday, September 2, 2011 6:03 AMModerator -
Thirsty,
A couple of comments on your code snippets:
#1 and #2 are unsupported bits of code that will probably not work at all in CRM 2011. My CRM Migration Assistant will convert the code like this:
Xrm.Page.getAttribute(
"new_projectid")./* CONVERSION ALERT */AddParam("ShowNewButton", "0"
);
Xrm.Page.getAttribute(
"new_partyid")./* CONVERSION ALERT */additionalparams = 'search='
+ searchValue;
As you can see, it doesn't totally convert the code, but it does let you know where the code may have issues with CRM 2011.
#3 is converted like this:
var
ParentForm = window.top.opener.parent.Xrm.Page.data.entity.attributes.get();
I have an update that will ship this week that has some revisions to the conversion process which includes conversions as noted above.
If you have other code that you feel is not converted properly, then please email me some code samples.
Mitch Milam
Chief Technologist
CRM Accelerators
visit my blog: http://blogs.infinite-x.net
mitch at crmaccelerators dot net
Mitch Milam, Microsoft MVP - CRM, http://blogs.infinite-x.net- Marked as answer by CRM Thirsty Wednesday, September 7, 2011 10:46 PM
Tuesday, September 6, 2011 1:25 PM
All replies
-
Try this tool.
http://crm2011scriptconvert.codeplex.com/
I hope this helps.
Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/- Proposed as answer by Amreek Singh Friday, September 2, 2011 5:15 AM
- Marked as answer by CRM Thirsty Friday, September 2, 2011 5:57 AM
Friday, September 2, 2011 5:15 AM -
Hi,
you can also refer
http://msdn.microsoft.com/en-us/library/gg509046.aspx
Mahain : MS CRM Freelancer- Proposed as answer by HIMBAPModerator Friday, September 2, 2011 5:22 AM
Friday, September 2, 2011 5:22 AMModerator -
Or, http://blogs.infinite-x.net/2011/07/30/crm-migration-assistant-1-2-released/
Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.- Marked as answer by CRM Thirsty Friday, September 2, 2011 5:57 AM
Friday, September 2, 2011 5:31 AMModerator -
Hi Amreek,
I have used this tool but it doesn't convert all the syntexes, though it convert basic standard statements very well.
Thanks for your time.
Thank you all for your help - CRM ThirstyFriday, September 2, 2011 5:52 AM -
Hi David,
Thanks for suggesting this tool.
This tool seems to convert more statments then tool posted on the codeplex.
but still it doesn't convert following statment.
"var parentForm = window.opener.parent.document.crmForm.all;"
Anyway, will get there.
Cheers
Thank you all for your help - CRM ThirstyFriday, September 2, 2011 5:57 AM -
- Marked as answer by CRM Thirsty Sunday, September 4, 2011 10:13 PM
Friday, September 2, 2011 6:03 AMModerator -
Thirsty,
A couple of comments on your code snippets:
#1 and #2 are unsupported bits of code that will probably not work at all in CRM 2011. My CRM Migration Assistant will convert the code like this:
Xrm.Page.getAttribute(
"new_projectid")./* CONVERSION ALERT */AddParam("ShowNewButton", "0"
);
Xrm.Page.getAttribute(
"new_partyid")./* CONVERSION ALERT */additionalparams = 'search='
+ searchValue;
As you can see, it doesn't totally convert the code, but it does let you know where the code may have issues with CRM 2011.
#3 is converted like this:
var
ParentForm = window.top.opener.parent.Xrm.Page.data.entity.attributes.get();
I have an update that will ship this week that has some revisions to the conversion process which includes conversions as noted above.
If you have other code that you feel is not converted properly, then please email me some code samples.
Mitch Milam
Chief Technologist
CRM Accelerators
visit my blog: http://blogs.infinite-x.net
mitch at crmaccelerators dot net
Mitch Milam, Microsoft MVP - CRM, http://blogs.infinite-x.net- Marked as answer by CRM Thirsty Wednesday, September 7, 2011 10:46 PM
Tuesday, September 6, 2011 1:25 PM -
Thanks Mitch,
I will let you know as it required.
Appreciate your time
Wednesday, September 7, 2011 10:46 PM