{"id":422,"date":"2014-04-30T11:07:27","date_gmt":"2014-04-30T11:07:27","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=422"},"modified":"2014-04-30T11:07:27","modified_gmt":"2014-04-30T11:07:27","slug":"opening-a-pre-populated-child-record-form-in-dynamics-crm","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2014\/04\/opening-a-pre-populated-child-record-form-in-dynamics-crm\/","title":{"rendered":"Opening a pre-populated child record form in Dynamics CRM"},"content":{"rendered":"<p><span style=\"line-height: 1.5em;\">In a 1:N relationship, when you add a new child record from within a parent form, it will open up the child form with data pre-populated from parent entity based on mapping provided in 1:N relationship.<\/span><\/p>\n<p>If you want to add a custom button to replicate the same behaviour, we can use the following code:<\/p>\n<p>var parameters = {};<br \/>\nvar childEntityName=&#8221;contact&#8221;;<\/p>\n<p>\/\/Provide parent record guid<br \/>\nparameters[&#8220;_CreateFromId&#8221;] = &#8220;08A03761-0996-E311-BC31-00155D000807&#8221;;<\/p>\n<p>\/\/Provide parent record entity type code<br \/>\nparameters[&#8220;_CreateFromType&#8221;] = &#8220;1&#8221;;<\/p>\n<p>\/\/provide child entity name and pass parameter to open new record<br \/>\nXrm.Utility.openEntityForm(childEntityName, null, parameters);<\/p>\n<p>Parameters:<\/p>\n<p>\u2022 _CreateFromId: Pass parent entity record\u2019s GUID<\/p>\n<p>\u2022 _CreateFromType: Pass parent entity type code<\/p>\n<p>\u2022 childEntityName: Child entity name which need to open with mapping field<\/p>\n<p>With this code snippet, you can add a custom button to simulate the + button on the child subgrids.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a 1:N relationship, when you add a new child record from within a parent form, it will open up the child form with data pre-populated from parent entity based on mapping provided in 1:N relationship. If you want to add a custom button to replicate the same behaviour, we can use the following code:\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2014\/04\/opening-a-pre-populated-child-record-form-in-dynamics-crm\/\">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":[19],"tags":[592,803,1356],"class_list":["post-422","post","type-post","status-publish","format-standard","hentry","category-dynamics-crm","tag-dynamics-crm","tag-field-mapping","tag-pre-populate"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/422","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=422"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/422\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}