Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

How to change security role lookup view

Posted on by 50,085

Hi Experts ,

I have one custom entity which I am using for my custom web resource  button show ,hide purpose. I have included security role lookup in this entity. But when I am selecting the security role  from lookup it does not populate the business unit name , I cant see the Business Unit name when I am clicking on more records as wll. Is there any way to change this security role view for security role lookup.

*This post is locked for comments

  • Suggested answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: How to change security role lookup view

    did you change the lookup view of security role entity? Please check what views is being used in your lookup property from the form editor.

    by default security role - lookup view has only name. you can change it from the customization.

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: How to change security role lookup view

    Hi All,

    I have found the solution for this. I am using Fetchxml to change the view -

     function SetSecurityRoleLookUpView() {
            //61F8D435-8E25-4751-8330-5969506EF536  --For Lookup view 
            //07625F32-B4E6-4E02-ABFB-592DCFDAC270  --Roles Advanced Find View
            var viewId = "{07625F32-B4E6-4E02-ABFB-592DCFDAC270}";
            var entityName = "role";
            var viewDisplayName = "Roles Advanced Find View";
    
            var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
                            "<entity name='role'>" +
                            "<attribute name='name'/>" +
                            "<attribute name='roleid'/>" +
                            "<attribute name='businessunitid'/>" +
                            "<order descending='false' attribute='name'/>" +
                            "</entity></fetch>";
    
            var layoutXml = "<grid name='resultset' " +
                         "object='1' " +
                         "jump='roleid' " +
                         "select='1' " +
                         "icon='1' " +
                         "preview='1'>" +
                     "<row name='result' " +
                          "id='roleid'>" +
                       "<cell name='name' " +
                             "width='200' />" +
                       "<cell name='businessunitid' " +
                             "width='150' />" +
                     "</row>" +
                   "</grid>";
    
            Xrm.Page.getControl("LookupFieldName").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);
        }



Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans