Permission Question

bhalpinbhalpin Member Posts: 309
Hi.

This is NAV 4.0 on NAV server.

The item table/card is heavily modified, and there are a series of new fields with a lookup form to choose values from.

I am trying to get this configured so that 'User A' has read access to the item table, but can change the values in the new fields (only) through the lookup form associated with those fields.

The user has been gived read access to the item table, and that prevents changes as expected. Then I set the permission property of the lookup form to give it write-access to that table.

But, when I tested it by logging in as that user and clicking F6 to choose a value, I still got the error that they are not allowed to make changes to the Item table.

So I tried changing that user'sr write access to the item table from '' to 'Indirect', but still it's no-go.

Is what I'm attempting possible? If so, what have I messed?

Thanks in advance.

Answers

  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    Hi,

    Lookup (standard, no custom C/AL code) is function which allows you to pick a value from another table. Has nothing to do with modifying record in current table.

    When you lookup for anything the value is picked from related table and put into field. Nothing more happens. then when you press Enter or leave field a VALIDATE is launched on the field. At that stage there is no MODIFY to the table, so you can actually select and put new value regardless of your rights to underlying table, unless OnValidate trigger tries to modify record.

    Then when you move to next record MODIFY is fired. At that point permissions are checked/enforced, and it doesn't matter what was used to change field value... lookup or just typing, or even only pressing F2 and then enter.

    Workaround is to write OnLookup code (in another codeunit) which pick and modify field you want, and also launches MODIFY on Item record, and give that codeunit right to modify Item table, and grand user indirect right to modify Item table.

    Hope this helps.

    Slawek
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • bhalpinbhalpin Member Posts: 309
    Hi Slawek.

    Yes, that helped. All is clear now.

    Bob
Sign In or Register to comment.