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
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
Thanks
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
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
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.
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;
André Arnaud de Cal...
292,886
Super User 2025 Season 1
Martin Dráb
231,768
Most Valuable Professional
nmaenpaa
101,156
Moderator