Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Permission to modify entry

Posted on by 543

Hi experts,

I use NAV 2016.

I need to change a few fields on a single Item Ledger Entry record.

I have made a new codeunit that would do the trick, if only I had the permissions to modify Item Ledger Entry.

I am SUPER.

When I try to add the Modify permission to the properties of the codeunit, it says that I do not have permissions to modify that record.

What am I doing wrong?

(I have also tried to put my code in OnOpen on the Item Card page. There I can add the permissions, but when I open the page, I get the same error.)

Hope you can help...

  • Morten Steengaard Profile Picture
    Morten Steengaard 543 on at
    RE: Permission to modify entry

    Hi Inge,

    You are right. (This is also what I tried to write on 19 August.)

    Best regards,

    Morten

  • Morten Steengaard Profile Picture
    Morten Steengaard 543 on at
    RE: Permission to modify entry

    Hi Amit.

    You are right. (This is also what I tried to write on 19 August.)

    Best regards,

    Morten

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: Permission to modify entry

    If you do not have a dev license / partner license you can modify the field directly on the SQL server as long as it is not a flow field.

    But you really need to know that you do not do any changes that make things worse by creating even more inconsistency.

  • Suggested answer
    Amit Baru Profile Picture
    Amit Baru 3,025 on at
    RE: Permission to modify entry

    Hi,

    Pls use Dev License for doing the above activity.

    Regards

    Amit Sharma

    www.erpconsultors.com

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

    Press Yes if Info is useful.

  • Morten Steengaard Profile Picture
    Morten Steengaard 543 on at
    RE: Permission to modify entry

    Hi ZHU,

    Thank you for your reply.

    On a Danish forum, I have been told that some tables have special permissions. The problem in my case was that I did not have the developer licens installed at the time.

    I totally agree with you, that this kind of programming is not recommended. I only do this in order to fix an inconsistency of the data, that a bug in a program has made.

    Thank you both ZHU and Nitin.

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,647 Super User 2024 Season 2 on at
    RE: Permission to modify entry

    Hi, Does the user performing the operation have Super permission? Nitin's suggestion is absolutely correct, you can follow Codeunit 80's practice. The same error will also be prompted if the user has insufficient permissions.

    PS: Personally do not recommend doing this, it will destroy the consistency of the data.

    Alternatively, you can modify the data directly in SQL.

    pastedimage1660865431781v1.png

    Hope this helps as well.

    Thanks.

    ZHU

  • Morten Steengaard Profile Picture
    Morten Steengaard 543 on at
    RE: Permission to modify entry

    Yes, I have made a new codeunit - number 50002:

    pastedimage1660828162897v1.png

    It only contains this code:

    ItemLedgerEntry.SETFILTER("Entry No.", '1336812');

    IF ItemLedgerEntry.FINDSET(TRUE) THEN
      REPEAT
        ItemLedgerEntry."Remaining Quantity" := 0;
        ItemLedgerEntry.Open := TRUE;
        ItemLedgerEntry.MODIFY;
      UNTIL ItemLedgerEntry.NEXT = 0;

    If I out comment this code, I still get the error, when trying to save the codeunit.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Permission to modify entry

    Have you written your code to modify ILE into custom CU?

    Please share your code.

    Thanks.

  • Morten Steengaard Profile Picture
    Morten Steengaard 543 on at
    RE: Permission to modify entry

    Now I have tried with rm, rimd and m. Same result.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Permission to modify entry

    Please try to give permission = rm

    Thanks.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans