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 

  • Dileep Gopinathan Profile Picture
    29 on at
    RE: How I can restrict editing vendors' NO in dynamic 365 business central

    Thanks

  • Suggested answer
    Govinda Kumar Profile Picture
    2,211 Moderator on at
    RE: How I can restrict editing vendors' NO in dynamic 365 business central

    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

  • Suggested answer
    NAV_with_Narang Profile Picture
    2,238 Moderator on at
    RE: How I can restrict editing vendors' NO in dynamic 365 business central

    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
    Inge M. Bruvik Profile Picture
    999 Moderator on at
    RE: How I can restrict editing vendors' NO in dynamic 365 business central

    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.

  • Verified answer
    Mohana Yadav Profile Picture
    60,199 Super User 2025 Season 1 on at
    RE: How I can restrict editing vendors' NO in dynamic 365 business central

    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;

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,886 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,768 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans