{"id":3079,"date":"2018-07-12T07:12:58","date_gmt":"2018-07-12T07:12:58","guid":{"rendered":"http:\/\/himbap.com\/blog\/?p=3079"},"modified":"2018-07-13T01:39:36","modified_gmt":"2018-07-13T01:39:36","slug":"setting-case-origin-from-dynamics-365-portal","status":"publish","type":"post","link":"https:\/\/himbap.com\/blog\/?p=3079","title":{"rendered":"Setting Case Origin from Dynamics 365 Portal"},"content":{"rendered":"<p>Sometime we may need to set default value for the entity field in portal forms. In this post we are going to discuss, how we can leverage entity form metadata to fulfil this requirement.<\/p>\n<p><strong>Requirement:<\/strong> Identify if case is created from Dynamics 365 Portal.<\/p>\n<p><strong>Solution:<\/strong> If you have worked with custom service module earlier then you might be aware of the Case Origin (caseorigincode) field which is a option set field. This field is used to configure case origin, for example if case is reported through phone, email, web etc. We can reuse this field to identify if case is reported from the Customer Portal. Let&#8217;s see how we can implement this using following steps:<\/p>\n<p>1. First add an option for Portal in case origin field, navigation to <strong>Settings-&gt;Customizations-&gt;<\/strong><strong>Customize the system<\/strong> from top navigation bar.<br \/>\n2. Navigate to <strong>Fields<\/strong> under Case entity and open case origin field.<br \/>\n3. Click on <strong>Edit<\/strong> button and add new option for Service Portal<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3080 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case1-300x164.png\" alt=\"case1\" width=\"300\" height=\"164\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case1-300x164.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case1-624x341.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case1.png 970w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<strong>**Keep note of value of the Service Portal<\/strong><br \/>\n4. Save and publish your changes.<br \/>\n5. Navigate to <strong>Portals-&gt;Entity Forms<\/strong> from top navigation bar.<br \/>\n6. Open your case entity form and Navigate to <strong>Entity Form Metadata<\/strong> section<br \/>\n7. Click on <strong>+<\/strong> sign, to create new <strong>Form Metadata<\/strong> record<br \/>\n8. Set <strong>Type<\/strong> as attribute and set attribute name<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3081 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case3-300x40.png\" alt=\"case3\" width=\"300\" height=\"40\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case3-300x40.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case3-624x83.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case3.png 1022w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n9. Navigate to <strong>Set Value On Save<\/strong> and use following option<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case4.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3082 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case4-300x123.png\" alt=\"case4\" width=\"300\" height=\"123\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case4-300x123.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case4-624x255.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case4.png 682w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<strong>**Make sure the value is matching to your Service Portal option value<\/strong><br \/>\n10. Save and Close your changes.<br \/>\nNow when you will create case from Portal, case origin will be set as<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case5.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3083 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case5-300x42.png\" alt=\"case5\" width=\"300\" height=\"42\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case5-300x42.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case5-624x88.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/case5.png 998w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Hope it will help someone!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometime we may need to set default value for the entity field in portal forms. In this post we are going to discuss, how we can leverage entity form metadata to fulfil this requirement. Requirement: Identify if case is created from Dynamics 365 Portal. Solution: If you have worked with custom service module earlier then you might be aware of&#8230; <a href=\"https:\/\/himbap.com\/blog\/?p=3079\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":3037,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[402,522,508],"tags":[503,542,545,544,543],"_links":{"self":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3079"}],"collection":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3079"}],"version-history":[{"count":7,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3079\/revisions"}],"predecessor-version":[{"id":3093,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3079\/revisions\/3093"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/3037"}],"wp:attachment":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}