web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Only owner of a contact to view specific fields and no one else

(0) ShareShare
ReportReport
Posted on by 160

Hi,

We are using Dynamics CRM 365 online V8.2 and having a requirement where, access to few fields (e.g. Email, Phone number) in contact form needs to be restricted, so that only owner of that contact can view and no else, unless that contact record was shared by the owner.

We considered,

1. Field level security doesn't work here, as the restriction is required at owner level

2. Child entity to hold those fields, but it will affect when we have the market automation in place as Email ID is a key field

Is there a better way to implement this business case?

Thanks,

Regards,

Praveen.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi Praveen Kumar Ellappa,

    Using JavaScript, you can show or hide fields based on the owner of the record. The general approach for building this is below.

    1. Create a JavaScript file that runs On Load of a contact record and On Change of the ownerid field on the contact entity.
    2. Compare the logged in User with the ownerid field. If they match then set the fields to visible, if they do not match set the fields to not visible.
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Praveen,

    As also mentioned above, you can write JS to show hide field based on the logged in user. You can use Xrm.Page.context.getUserId() to get the logged in user id and compare it with ownerid and then add your show/ hide logic

    Hope this helps.

  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    If possible you can keep all these type of field under on tab and hide and show that tab based on the user, you can check something like below

    If(Xrm.Page.context.getUserId()==Xrm.Page.getAttribute("ownerid").getValue()[0].id)

    {

    //hide tab

    Xrm.Page.ui.tabs.get("tabname").setVisible(true);

    }

    else

    {

    Xrm.Page.ui.tabs.get("tabname").setVisible(false);

    }

  • Praveen Kumar Ellappa Profile Picture
    160 on at

    Hi All,

    Thanks for your response. May be I didn’t mention the requirement clearly. Its not necessary to hide the field, even if we are able to hide/encrypt those fied’s value will also do. And also, It’s not just in the form, even in views and reports those field values should be viewed only the record owner.

    Is this a possibility?

    Thanks,

    Praveen.

  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi Praveen Kumar Ellappa,

    Field Security Profiles are your only option if you need to restrict the access of fields on record forms, data access requests within the client application, web service calls using the SDK, and data display on report. However, Field Security Profiles can only be assigned manually to Users and Teams, so you will need to assign and unassign Field Security Profile members whenever the record owner changes.

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Agree, you need to handle this using field level security.

  • Verified answer
    Drew Poggemann Profile Picture
    4 on at

    Hi Praveen,

    One more option, which may not meet your needs specifically, would be to utilize Access Teams.  community.dynamics.com/.../access-teams

    You could assign the security of the records to only be available for view at the specific user level on the contacts and then if you want to share access to these with other team members you can add them to an access team on the record.  This is not perfect in any way because it limits the access to the contact record to the owner and then the access team members but just another thought.

    Hope this helps.

  • Praveen Kumar Ellappa Profile Picture
    160 on at

    Hi Adrian,

    I need to admit that, this business case is bit complex, where Field level security doesn't serve the purpose for us. Cos, the access restriction is based on record ownership and not generic to set of users of that entity.

    Regards,

    Praveen.

  • Praveen Kumar Ellappa Profile Picture
    160 on at

    Hi Drew,

    Thanks for your reply. Let me go through this requirement and see how if this can help.

    Regards,

    Praveen.

  • Suggested answer
    Ben Thompson Profile Picture
    6,350 on at

    The only way to achieve the requirement (I've seen the same one before) is to create a separate entity for the restricted fields and only provide read access at the owner level.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans