Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Access denied to the f...
Finance forum
Suggested answer

Access denied to the field error due to security role

Posted on by Microsoft Employee

Hi,

I want to hide a field in the form from some users so I have created a security role for this purpose. I gave full permission to the table but gave "access denied" to that field. Now whenever the user with that role opens the form, he doesn't see the field along with the error "access denied to the field". Somewhere in the back of the code,  the exception occurs when that field is hit. Although I have added if condition but it doesn't work. This field in the table has AOS authorization true on it and the table is out of the box.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 287,696 Super User on at
    RE: Access denied to the field error due to security role

    Hi ERP Community,

    When you get the error when changing the TaxIdType enum, there is probably some coding executed which tries to access the Tax1099RegNum field. Then indeed, you can expect an error.

    Should the user be able to change the enum? If not, you can consider making that field read only. If the user needs to be able to change it, you would probably need a customization to remove the field from the form and ensure the user will not be able to see the value in a different way (e.g. show all fields).

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Access denied to the field error due to security role

    Hi,

    Thanks. After implementing the solution, the error doesn't appear as long as I do not modify the TaxIdType enum. As I modify this field, the same error appears 

    What do you suggest in this matter?

    Thanks for the reply!

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 287,696 Super User on at
    RE: Access denied to the field error due to security role

    Hi,

    I just tried it on a preview of 10.0.27 using the Security configuration form in the application. I didn't get the additional error. Can you tell if you have a similar setup as I will mention below or did you create the security different (other privileges or using Visual Studio based development)?

    I provided a role with the standard duty (with the standard privileges) for maintaining vendor master. With a second role, I added a new privilege with deny permissions for the specific field via the table permissions node. Just a new privilege with the deny access on the same role should also work fine.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Access denied to the field error due to security role

    Hi,

    The version of the product that I am using right now is 10.0.25 (10.0.1149.40).

    The table I am working on is vendTable and the field is Tax1099RegNum.

    Thanks

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 287,696 Super User on at
    RE: Access denied to the field error due to security role

    Hi ERP Community,

    What exact version of Dynamics 365 F&O are you running? Can you tell which exact field on what table you try to restrict?

  • Suggested answer
    abdultp Profile Picture
    abdultp 865 on at
    RE: Access denied to the field error due to security role

    If you want to do it on table level from UI, the minimum access needs to be granted is 'read' which is completely against basic idea of hiding the Field as you mentioned. If you deny the read permission for a field it'll throw the error and user will not have access to the form.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Access denied to the field error due to security role

    Thanks for your swift response. However, I was thinking is there any possible way of doing it on table level other than on form level as it can cause other issues in business logic.

  • Suggested answer
    abdultp Profile Picture
    abdultp 865 on at
    RE: Access denied to the field error due to security role

    Hi,

    Extend the form if it's standard one, then in design section of form go to the the form control which you want to hide & change the needed permission to 'Manual'.

    Find the privilege for the role where this display menu item is assigned to the entry point & add the same form control which you wanted to hide with the permission of 'Read'.

    Assign the role to the users who shouldn't be able to view that field. Refer the below images for better understanding through standard form & Privilege.

    pastedimage1652902359758v1.png

    pastedimage1652902458307v2.png

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Access denied to the field error due to security role

    I have tried numerous solutions but nothing worked. Kindly help me get through it. Thanks in advance!

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans