Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Suggested answer

How to allow a user to create a record but without the rights to edit the existing records

Posted on by 10

Hi i was wondering if this is entirely possible,

What i want to achieve is.

User A can Create and Edit a Customer Record

User B Can Create and cannot Edit a Customer Record.

I tried playing around the permission sets but i think the Modify Permission is required to be able to insert a new record.

Is this achievable?

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,744 Moderator on at
    RE: How to allow a user to create a record but without the rights to edit the existing records

    You will have to be on a version that supports the AL programming language in order to do customization with out a development license.

    So you will need to purchase that granul to have it added to your license.

  • Suggested answer
    Amit Baru Profile Picture
    Amit Baru 3,025 on at
    RE: How to allow a user to create a record but without the rights to edit the existing records

    hi,

    No. This is user license not development license.

    Regards

    Amit Sharm

    www.erpconsultors.com

    linkedin.com/in/amit-sharma-94542440/

    Press Yes if info is useful.

  • Arnaz De Jesus Profile Picture
    Arnaz De Jesus 10 on at
    RE: How to allow a user to create a record but without the rights to edit the existing records

    IMG_2D00_0c267c3df2b6f4458d1220ba495a36e0_2D00_V.jpg

    Hi this is the one included on my license please kindly check if i am allowed to do the customization with that license. 

    Thanks

  • Suggested answer
    Amit Baru Profile Picture
    Amit Baru 3,025 on at
    RE: How to allow a user to create a record but without the rights to edit the existing records

    Hi,

    Dev license is mandatory for doing the recommended customization

  • Arnaz De Jesus Profile Picture
    Arnaz De Jesus 10 on at
    RE: How to allow a user to create a record but without the rights to edit the existing records

    Hi, already created the "Restrict Customer Modification" field for user setup, however i cannot seem to access the C/AL code from my object designer, is that where i can input the code you provided? If yes is there a problem on my license since the C/AL code option is greyed out.

    Thanks

  • Suggested answer
    Amit Baru Profile Picture
    Amit Baru 3,025 on at
    RE: How to allow a user to create a record but without the rights to edit the existing records

    Hi,

    Follow the below steps:

    1. "Restrict Customer Modification" field in User Setup table and same display in User Setup Page by using extension of both object

    2.  Write code on "OnModify" of Customer Table by using Customer Table Extension.

    3. Code already explained in the pervious reply.

    Regards

    Amit Sharma

    www.erpconsultors.com

    https://www.linkedin.com/in/amit-sharma-94542440/

    Press Yes Button if info is useful.

  • Arnaz De Jesus Profile Picture
    Arnaz De Jesus 10 on at
    RE: How to allow a user to create a record but without the rights to edit the existing records

    Hi, thanks for the detailed solution but i was hoping if you can help me more about it. Where should i create the "Restrict Customer Modify" is it on User Setup Page or User Setup Table?

    Thanks

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 70,099 Super User 2024 Season 2 on at
    RE: How to allow a user to create a record but without the rights to edit the existing records

    Hi, Yes, it's possible, the easiest way is what Amit mentioned, adding controls in different triggers.
    But this requires customization.

    More details:

    pastedimage1661469921479v1.png

    Hope this helps as well.

    Thanks.

    ZHU

  • Suggested answer
    Amit Baru Profile Picture
    Amit Baru 3,025 on at
    RE: How to allow a user to create a record but without the rights to edit the existing records

    Hi,

    It is possible.

    Create "Restrict Customer Modify" Field in User setup and write code on "OnModify" trigger of Customer Table

    UserSetup : Record User Setup

    Code:

    UserSetup.get(UserId);

    if not UserSetup."Restrict Customer Modify" then

      error('You do not have permission to modify.);

    Regards

    Amit Sharma

    www.erpconsultors.com

    linkedin.com/in/amit-sharma-94542440/

    Pls press Yes if Info is useful.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,744 Moderator on at
    RE: How to allow a user to create a record but without the rights to edit the existing records

    It is possible. But you have to build a layer between user B and the customer table.

    Typically you can build that is not using the customer table as the dataitem. But have the variables defined that match the data you want the user to register in the customer record. Then you let code on the page do the insert in the customer record. And you give the page it self permissions to insert and edit in the customer table.

    Then the user can have indirect right to create and edit customers.

    You can read more about indirect permissions here.

    docs.microsoft.com/.../devenv-permissions-property

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,645 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans