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 :
Small and medium business | Business Central, N...
Suggested Answer

Permission set to RIMD, but Item Modify Error

(0) ShareShare
ReportReport
Posted on by 130

Hi BC Community,

My code is below , but when I run it to update the item cost, I get prompted with permissions error for item.modify.

Appreciate any guidance....this should work shouldn't it?

codeunit 60001 c60001ResetDirectUnitCost
{
    Permissions =
        tabledata Item = RIMD, tabledata "Item Amount" = RIMD;

    //Permissions = tabledata "Purchase Line" = m;
    [EventSubscriber(ObjectType::Table, Database::"Purchase Line", 'OnAfterUpdateDirectUnitCost', '', false, false)]
    local procedure MyProcedure(var PurchLine: Record "Purchase Line")
    var
        item: Record item;
    begin
        if PurchLine."Document Type" = PurchLine."Document Type"::Quote then
            if PurchLine.Type = PurchLine.Type::Item then begin
                Item.Get(PurchLine."No.");
                if Item.Type = Item.Type::"Non-Inventory" then begin
                    item."Last Direct Cost" := 0;
                    PurchLine.Validate("Direct Unit Cost", 0);
                    PurchLine.Validate("Tax Area Code", 'CA');
                    PurchLine.Validate("Tax Group Code", 'TAXABLE');
                    Item.Modify();
                end;
            end;
    end;
}

pastedimage1674785673528v2.png

I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    Have you tried to debug this? The error message you are getting does not look like a standard error message. Maybe you have some other extensions installed that prevents you from updating the items?

  • Suggested answer
    YUN ZHU Profile Picture
    95,729 Super User 2025 Season 2 on at

    Hi, I think this is standard error.

    For example,

    pastedimage1675044498022v1.png

    So it's still a permissions issue.

    is it possible that the currently executing user does not have permission? Please try using Super User.

    Or have you generated permissions file for your Extension, and assign it to the user?

    pastedimage1675044611168v2.png

    Hope this helps.

    Thanks.

    ZHU

  • SammySevens Profile Picture
    130 on at

    Hi Zhu,

    Thank you for the feedback. I am sure it is a permission issue as when I set Item_Modify = YES for the user - the user is able to proceed.

    I will investigate this further. Thank you

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,135

#2
YUN ZHU Profile Picture

YUN ZHU 733 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 612

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans