web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
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 132

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

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 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
    104,157 Super User 2026 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
    132 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 624 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 440 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 244 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans