{"id":5,"date":"2013-12-12T12:00:00","date_gmt":"2013-12-12T06:30:00","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=5"},"modified":"2013-12-12T12:00:00","modified_gmt":"2013-12-12T06:30:00","slug":"pass-custom-parameters-to-an-entity-form-through-a-url-in-crm-2013","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2013\/12\/pass-custom-parameters-to-an-entity-form-through-a-url-in-crm-2013\/","title":{"rendered":"Pass Custom Parameters to an entity form through a URL in CRM 2013"},"content":{"rendered":"<div dir=\"ltr\" trbidi=\"on\"><span><\/span><br \/><span>This <a href=\"http:\/\/inogic.blogspot.in\/2012\/01\/pass-custom-parameters-to-entity-form.html\" target=\"_blank\" rel=\"noopener noreferrer\">blog<\/a> posted back in 2012, described how to pass custom parameters to an entity in CRM 2011. The other day tried to use the same code to make it in CRM 2013 but unfortunately that would not work. You will be able to pass a single parameter through the URL using the same code as before, but to pass more than one parameters, you need to use the new openEntityForm client API.<\/span><br \/><span><\/span><br \/><span>In 2011, the parameters would be concatenated to make\u00a0a string and pass that as the extraqs query string<\/span><br \/><span><\/span><br \/><span> <\/span><span lang=\"EN-US\"><span><span>var extraqs = &#8220;Parameter_Source=Hello&#8221;;<br \/>extraqs += &#8220;parameter_Source2=8&#8221;;<\/p>\n<p><\/span><\/span><\/span><br \/><span> <\/span><\/p>\n<div><span lang=\"EN-US\"><span><span>\/\/Set features for how the window will appear.<br \/>var features = &#8220;location=no,menubar=no,status=no,toolbar=no&#8221;;<\/p>\n<p><\/span><\/span><\/span><\/div>\n<p><span> <\/span><span lang=\"EN-US\"><span>\/\/ Open the window.<br \/>window.open(Xrm.Page.context.getServerUrl() +&#8221;\/main.aspx?etn=account&#038;pagetype=entityrecord&#038;extraqs=&#8221; + encodeURIComponent(extraqs), &#8220;_blank&#8221;, features, false);<\/span><\/span><br \/><span lang=\"EN-US\"><span><\/span><\/span><br \/><span lang=\"EN-US\"><span>Using the new client API to open the record, this would now be presented as follows<\/span><\/span><br \/><span lang=\"EN-US\"><br \/><span lang=\"EN-US\"><span><span>var parameters = {};<\/p>\n<p><\/span><\/span><\/span><br \/><span> <\/span><\/p>\n<div><span lang=\"EN-US\"><span><span>parameters[&#8220;myparam_test&#8221;] = &#8220;1&#8221;;<\/p>\n<p><\/span><\/span><\/span><\/div>\n<p><span> <\/span><\/p>\n<div><span lang=\"EN-US\"><span><span>parameters[&#8220;parameter_test&#8221;] = &#8220;100&#8221;;<\/p>\n<p><\/span><\/span><\/span><\/div>\n<p><span> <\/span><\/p>\n<div><span lang=\"EN-US\"><span><span>\/\/use the openEntityForm to open the record <\/p>\n<p><\/span><\/span><\/span><\/div>\n<p><span> <\/span><\/p>\n<div><span lang=\"EN-US\"><span><span>Xrm.Utility.openEntityForm(&#8220;account&#8221;, null, parameters); <\/p>\n<p><\/span><\/span><\/span><\/div>\n<p><span> <\/span><\/span><span><\/span><br \/><span> <\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This blog posted back in 2012, described how to pass custom parameters to an entity in CRM 2011. The other day tried to use the same code to make it in CRM 2013 but unfortunately that would not work. You will be able to pass a single parameter through the URL using the same code\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2013\/12\/pass-custom-parameters-to-an-entity-form-through-a-url-in-crm-2013\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[21,22,24],"tags":[],"class_list":["post-5","post","type-post","status-publish","format-standard","hentry","category-dynamics-crm-2013","category-dynamics-crm-2015","category-dynamics-crm-2016"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/5","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=5"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/5\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}