{"id":191,"date":"2022-01-06T11:34:57","date_gmt":"2022-01-06T11:34:57","guid":{"rendered":"https:\/\/blog.citrus-lime.com\/crmc\/?p=191"},"modified":"2022-01-06T11:34:57","modified_gmt":"2022-01-06T11:34:57","slug":"field-level-security-in-dynamics-crm","status":"publish","type":"post","link":"https:\/\/blog.citrus-lime.com\/crmc\/field-level-security-in-dynamics-crm\/","title":{"rendered":"Field Level Security in Dynamics CRM"},"content":{"rendered":"\n<p>Prior to CRM 2011, one of the most requested developments was the ability to lock a particular user or group of users from a particular field.<\/p>\n\n\n\n<p>To combat this requirement, Microsoft introduced true Field Level Security back with CRM 2011 and this has since formed part of the core platform in CRM 2013, 2015 and now 2016.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Business Scenario<\/h3>\n\n\n\n<p>We want to prevent certain users to view a Company\u2019s Billing Addresses but be prevented from modifying Billing Addresses, whilst still being able to modify the Company\u2019s Correspondence Address.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/clip_image001_40853915.png\" alt=\"clip_image001\" title=\"clip_image001\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Solution Design<\/h3>\n\n\n\n<p>We would avoid using Security Roles to implement this requirement, as this would potentially block a User from modifying any Address or any Company record in CRM.<\/p>\n\n\n\n<p>As we want to allow edits to the main Correspondence Address, but block edits to the Billing Address (address2 in CRM speak!), we would opt to use Field Security to restrict access to the second address fields.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How we do it<\/h3>\n\n\n\n<p><strong>1.<\/strong>&nbsp;If we do not already have a Solution in Dynamics to hold our Security Settings, we should create a new Solution that we can use to track any new or amended Security Roles or Field Security Profiles.&nbsp; We can then open this solution and perform the following steps.<\/p>\n\n\n\n<p><strong>2.<\/strong>&nbsp;First of all, we will need to specify which fields we want to enable Field-Level Security for.&nbsp; This is done within the Fields Area for the CRM Entity involved \u2013 and so we need to add the Customer Account entity into our solution and then access the list of Fields available for this Entity.<\/p>\n\n\n\n<p>From here, we can edit any particular field to enable Field-Level Security for that Field.<\/p>\n\n\n\n<p><strong>NOTE:&nbsp;<\/strong>Unfortunately we are not able to do this in bulk using the native interface for Dynamics and so need to do this one field at a time.<\/p>\n\n\n\n<p><strong>TIP:&nbsp;<\/strong>Avoid doing one field at a time, but instead open a range of new browser windows, one for each field<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image3_3D23A16D.png\" alt=\"image\" title=\"image\" \/><\/figure>\n\n\n\n<p><strong>3.<\/strong>&nbsp;Changes to Field Level Security only take place after being Published, so we need to Publish our Solution before continuing.<\/p>\n\n\n\n<p><strong>4.<\/strong>&nbsp;Once we have our Fields enabled for Field Level Security and Published, we can then setup a Field Security Profile to govern who has access to each field.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image22_741D7FA6.png\" alt=\"image\" title=\"image\" \/><\/figure>\n\n\n\n<p><strong>5.<\/strong>&nbsp;In our new Field Security Profile we then determine the Permission Level over each Security Enabled Field:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image25_387D70E6.png\" alt=\"image\" title=\"image\" \/><\/figure>\n\n\n\n<p>Each field can then allow either:<\/p>\n\n\n\n<p><strong>Read Permission \u2013&nbsp;<\/strong>are users associated with this Field Level Security Profile allowed to view the contents of this field?<\/p>\n\n\n\n<p><strong>Write Permission \u2013&nbsp;<\/strong>similarly can users edit the contents of this field?<\/p>\n\n\n\n<p><strong>Create Permissions \u2013&nbsp;<\/strong>slightly more outlandish, but can users set the initial value of this field when creating a new record?<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image29_04C4DEBB.png\" alt=\"image\" title=\"image\" \/><\/figure>\n\n\n\n<p>So in our example of restricting access to all the Address 2 fields, we would configure our Profile with YES for the Read Permission, but NO for Write and Create Permissions \u2013 implementing a \u2018look but don\u2019t touch\u2019 approach to the fields.<\/p>\n\n\n\n<p><strong>6.<\/strong>&nbsp;Once we have defined the rules our Field Level Security Profile will enforce, we can then apply this Profile to various Users or Teams in CRM.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image32_33C71A92.png\" alt=\"image\" title=\"image\" \/><\/figure>\n\n\n\n<p>We can choose to apply this profile to either specific Users, or to whichever Users are in a particular Team to give us a more flexible approach.<\/p>\n\n\n\n<p><strong>7.<\/strong>&nbsp;We can then view the Customer Account Form in CRM to see our new Security in action:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image13_26ECC474.png\" alt=\"image\" title=\"image\" \/><\/figure>\n\n\n\n<p>At this point, any users using the restricted Field Security Profile will have locked-down Read-Only permissions on the Fields.<\/p>\n\n\n\n<p>Whereas any users using the enhanced Field Security Profile will have normal Read\/Write access to the Field.<\/p>\n\n\n\n<p>Regardless of Permission Level, the Fields will be shown with the&nbsp;<strong>Key Icon<\/strong>&nbsp;to indicate that these Fields have Field Level Security Enabled.<\/p>\n\n\n\n<p><strong>8.<\/strong>&nbsp;If the \u2018Allow Read\u2019 permission to set to NO, this will remove access to the Field in Views and Advanced Finds as well as the Form.&nbsp; This does NOT remove access to the Field in developed SSRS \/ SQL Reports \u2013 any logic for field restrictions must also be built into these developed reports as part of the report, as the CRM Platform does not enforce Field Level Security outside CRM in SQL Reports.<\/p>\n\n\n\n<p><strong>9.<\/strong>&nbsp;However if the \u2018Allow Read\u2019 or \u2018Allow Update\u2019 permissions are set to NO, this also blocks these permissions for any automated logic that is running as this User.&nbsp; So any Workflows or developed Plugins which need to read or update a particular field will fail with a security error!<\/p>\n\n\n\n<p><strong>10.<\/strong>&nbsp;This differs from making the field Read-Only on the Form \u2013 in that the Form Design is modifying the User Interface only, whereas Field Level Security is imposing a hard security restriction.&nbsp; So for example, a Workflow or Plugin can still update a Field which is Read-Only on the Form, whereas Field Level Security will prevent any this update if the user does not have \u2018Allow Read\u2019 permission.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Tips<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Security Roles implement record-level security \u2013 i.e. can I see a record, can I edit a record.&nbsp; Field Security Profiles implement field-level security on a field by field basis.&nbsp;&nbsp;<strong>Record Level Security always has a higher priority over Field Level Security!<\/strong><\/li><li>Users with the System Administrator Security Role override the Field Level Security configuration and automatically have Read+Write+Create permissions on the Fields involved<\/li><li>Certain System Fields cannot be enabled for Field-Level Security, and this may vary depending on the version of Dynamics CRM involved \u2013 for example the Address2 fields in CRM 2011 cannot be enabled for Field Level Security, whereas Address2 can be enabled in CRM 2015<\/li><li>As soon as enable Field Level Security on a Field, this immediately takes away access to the Field for all Non-System Admin Users and so should be done carefully!&nbsp; (or ideally in a separate Development or Test Environment and then the Security Profiles deployed to Live)<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Best Practise<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Our advise is always to start with the most generous level of security and then add additional security rules (whether these be Record-Level or Field-Level) as required; so give us the smallest and simplest number of security rules in place in the solution.&nbsp; This keeps to the KISS principle of keeping the solution simple.<\/li><li>Always use Teams over specific Users to drive Field Security Profiles, this makes User Management more simple for CRM Administrators to handle New Starters and Leavers.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Further Reading<\/h3>\n\n\n\n<p><strong>How field security can be used to control access to field values in Microsoft Dynamics CRM<\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/msdn.microsoft.com\/en-gb\/library\/gg309608.aspx\">https:\/\/msdn.microsoft.com\/en-gb\/library\/gg309608.aspx<\/a><\/p>\n\n\n\n<p><strong>Enhanced Field-level Security Features for CRM 2015<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-powerobjects wp-block-embed-powerobjects\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"Wdqaz9ZjcY\"><a href=\"https:\/\/powerobjects.com\/crm-2015\/enhanced-field-level-security-features-for-crm-2015\/\">Enhanced Field-level Security Features for CRM 2015<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Enhanced Field-level Security Features for CRM 2015&#8221; &#8212; PowerObjects\" src=\"https:\/\/powerobjects.com\/crm-2015\/enhanced-field-level-security-features-for-crm-2015\/embed\/#?secret=Wdqaz9ZjcY\" data-secret=\"Wdqaz9ZjcY\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><strong>CRM 2013 \u2013 How to set up Field Level Security<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-link is-provider-hosk-039-s-dynamic-blog wp-block-embed-hosk-039-s-dynamic-blog\"><div class=\"wp-block-embed__wrapper\">\n<a href=\"https:\/\/crmbusiness.wordpress.com\/2014\/05\/22\/crm-2013-how-to-set-up-field-level-security\/\">CRM 2013 &#8211; How to set up Field Level&nbsp;Security<\/a>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Prior to CRM 2011, one of the most requested developments was the ability to lock a particular user or group of users from a particular field. To combat this requirement, Microsoft introduced true Field Level Security back with CRM 2011 and this has since formed part of the core platform in CRM 2013, 2015 and<\/p>\n","protected":false},"author":43,"featured_media":35,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"footnotes":""},"categories":[3],"tags":[],"class_list":{"0":"post-191","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-crm"},"featured_image_src":"https:\/\/blog.citrus-lime.com\/crmc\/wp-content\/uploads\/sites\/30\/2021\/11\/Dynamics-365-Consultancy.jpg","author_info":{"display_name":"jadesmith","author_link":"https:\/\/blog.citrus-lime.com\/crmc\/author\/jadesmith\/"},"_links":{"self":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/comments?post=191"}],"version-history":[{"count":1,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/191\/revisions"}],"predecessor-version":[{"id":192,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/191\/revisions\/192"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/media\/35"}],"wp:attachment":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/media?parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/categories?post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/tags?post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}