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...
Answered

How I can restrict editing vendors' NO in dynamic 365 business central

(0) ShareShare
ReportReport
Posted on by 29

Hi Team, 

How I can restrict editing vendors' NO  in dynamic 365 business central, Once created the Vendor card no on can edit the vendor NO. 

Thanks 

Dileep G 

I have the same question (0)
  • Verified answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at

    You can achieve it with small customization.

    [EventSubscriber(ObjectType::Table, Database::Vendor, 'OnBeforeRenameEvent', '', false, false)]

       local procedure OnBeforeRenameEventVendor(var Rec: Record Vendor; var xRec: Record Vendor; RunTrigger: Boolean)

       begin

           Error('Renaming Vendor No. is not allowed.');

       end;

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    It is a bad idea to do this in code. You should use the permission setup to prevent none authorized users from modifying a vendor no.

    There might be situation where you actually want to modify the vendor no. and that is a standard function in the system. So use the permission instead of doing this in code.

  • Suggested answer
    NAV_with_Narang Profile Picture
    2,294 Moderator on at

    Best to achieve by permission sets, which is a recommended approach and also suggested by NorthW 

    You can also do it, the "non-ideal" way by doing an extension which will make the Number Field un-editable on the vendor card, this will however allow users to rename the vendor number by importing vendors via Configuration Package. You can write a subscriber to prevent this editing. I'll never do this via an extension as it will create a lot of operational loopholes

    Do verify the answer by clicking "YES" for "Did this answer your question" - if you feel it helped you in anyway, so that others can benefit out of it too. Thankyou very much for taking out time to read

  • Suggested answer
    Govinda Kumar Profile Picture
    2,304 Moderator on at

    Hi,

    you can simply modify the editable property of vendor no and add the condition like below.

    var   EditVendorNO:Boolean;

    property on ur field

    ApplicationArea = All;

    Editable = EditVendorNO;

    condition.. like this

    EditVendorNO:= true;

    if (Rec."No" <> ' ') then begin

    EditVendorNO := false;

    end

    else begin

    EditVendorNO := true;

    end;

    Thanks

  • Dileep Gopinathan Profile Picture
    29 on at

    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

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,785

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,007 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 948 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans