{"id":18658,"date":"2019-05-16T12:12:06","date_gmt":"2019-05-16T12:12:06","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=18658"},"modified":"2021-12-06T15:35:11","modified_gmt":"2021-12-06T10:05:11","slug":"how-to-set-default-value-of-allow-other-dynamics-365-user-to-send-email-on-your-behalf-as-true-programmatically","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2019\/05\/how-to-set-default-value-of-allow-other-dynamics-365-user-to-send-email-on-your-behalf-as-true-programmatically\/","title":{"rendered":"How to Set Default Value of \u2018Allow other Dynamics 365 user to send email on your behalf\u2019 as \u2018True\u2019 programmatically"},"content":{"rendered":"<h2><strong>Introduction<\/strong><\/h2>\n<p style=\"text-align: justify;\">In Dynamics 365 CRM, user can modify his personal setting through <strong>Set Personal Options<\/strong> by clicking Gear Symbol present in Left side of form, after login into CRM.<\/p>\n<p style=\"text-align: justify;\">But most of the time user is unaware about the options that are available in Personal Setting. For Example, <strong>Allow other Microsoft Dynamics 365 user to send email on your behalf<\/strong> have false value by default and user forgets to set value as <strong>True<\/strong>. In this scenario, administrator user is unable to send an email on behalf of that user.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-18659\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/05\/1Set-Default-Value.png\" alt=\"Set Default Value\" width=\"1290\" height=\"496\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/05\/1Set-Default-Value.png 1290w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/05\/1Set-Default-Value-300x115.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/05\/1Set-Default-Value-768x295.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/05\/1Set-Default-Value-1024x394.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/05\/1Set-Default-Value-660x254.png 660w\" sizes=\"(max-width: 1290px) 100vw, 1290px\" \/><\/p>\n<p style=\"text-align: justify;\">So in this blog, we will focus on how to update user personal setting, i.e. set default value of <strong>Allow other Microsoft Dynamics 365 user to send email on your behalf <\/strong>programmatically (without login into CRM).<\/p>\n<p style=\"text-align: justify;\">Recently, we came across a scenario where an administrator user wants to send an email on behalf of some other user. In this case, if by default <strong>Allow other Microsoft Dynamics 365 user to send email on your behalf<\/strong> is not true then it will throw an error message as <strong>User Does not have permission to send Email<\/strong>.<\/p>\n<p style=\"text-align: justify;\">To avoid this situation, we need to programmatically set <strong>Allow other Microsoft Dynamics 365 user to send email on your behalf<\/strong> as <strong>true<\/strong> in User Personal Setting<strong>.<\/strong><\/p>\n<p>To achieve this, we can either write plugin or assembly for the same.<\/p>\n<p style=\"text-align: justify;\">We accomplished the same by using workflow assembly, because as per our functionality we required On Demand workflow. But you can also achieve the same by using plugin with Images i.e. <strong>Post Image.<\/strong><\/p>\n<p style=\"text-align: justify;\">Given below are the steps to set <strong>Allow other Microsoft Dynamics 365 user to send email on your behalf<\/strong> as <strong>True<\/strong> programmatically.<\/p>\n<p>Step 1: Create workflow assembly.<\/p>\n<p>Code Snipped to update user form Assembly and plugin<\/p>\n<p>\/\/Entity Name<\/p>\n<p>Entity userSetting = new Entity(&#8220;usersettings&#8221;);<\/p>\n<p>\/\/Guid Of the user record<\/p>\n<p>userSetting.Id = userId;<\/p>\n<p>\/\/Attribute to set value of \u201c<strong>Allow other Microsoft Dynamics 365 user to send email on your behalf<\/strong>\u201d<\/p>\n<p>userSetting[&#8220;issendasallowed&#8221;] = true;<\/p>\n<p>\/\/Update the Record<\/p>\n<p>service.Update(userSetting);<\/p>\n<p>Step 2: Register Assembly.<\/p>\n<p>Step 3: Create <strong>On Demand<\/strong> workflow which will also trigger on change of <strong>Outgoing Email Delivery Method<\/strong> field and call registered assembly in workflow.<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<h2 style=\"text-align: left;\"><div class=\"su-heading su-heading-style-default su-heading-align-center\" id=\"\" style=\"font-size:15px;margin-bottom:5px\"><div class=\"su-heading-inner\">One Pic = 1000 words! Analyze data 90% faster with visualization apps!<\/div><\/div><\/h2>\n<p style=\"text-align: left;\"><em>Get optimum visualization of Dynamics 365 CRM data with &#8211;<\/em><br \/>\n<em><strong><a href=\"https:\/\/bit.ly\/3lYvozZ\" target=\"_blank\" rel=\"noopener noreferrer\">Kanban Board<\/a> <\/strong>\u2013 Visualize Dynamics 365 CRM data in Kanban view by categorizing entity records in lanes and rows as per their status, priority, etc.<\/em><br \/>\n<em><strong><a href=\"https:\/\/bit.ly\/3lCSBaA\" target=\"_blank\" rel=\"noopener noreferrer\">Map My Relationships<\/a><\/strong> \u2013 Map My Relationships \u2013 Visualize connections and relationships between Dynamics 365 CRM entities or related records in a Mind Map view.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In Dynamics 365 CRM, user can modify his personal setting through Set Personal Options by clicking Gear Symbol present in Left side of form, after login into CRM. But most of the time user is unaware about the options that are available in Personal Setting. For Example, Allow other Microsoft Dynamics 365 user to\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2019\/05\/how-to-set-default-value-of-allow-other-dynamics-365-user-to-send-email-on-your-behalf-as-true-programmatically\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":18661,"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":[16,19],"tags":[],"class_list":["post-18658","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365","category-dynamics-crm"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/18658","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=18658"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/18658\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/18661"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=18658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=18658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=18658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}