Dear All,
i have one issue in this new requirement
We want to allow/restrict the users to reopen the Purchase order once its released. only allowed user can should have to do this
for this i have created like this Pls correct me where i did the makes the Mistakes
I created a table extension in User setup with Boolean value and Codeunit for this. is this is the right way.
tableextension 60100 "User Setup Ext" extends "User Setup"
{
fields
{
// Add changes to table fields here
field(60102; "Purchase Order Release"; Boolean)
{
Caption = 'PO Release';
Data Classification = Customer Content;
}
}
}
codeunit 60105 PreventRelease
{
trigger onRun()
begin
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Release Purchase Document", 'OnBeforePerformManualCheckAndRelease', '', false, false)]
local procedure PreventRelease(var PurchHeader: Record "Purchase Header"; var isHandled: Boolean)
begin
var
UserSetup: Record "User Setup"
begin
if userSetup.get(UserId) then
if userSetup."Purchase Order Release" then
exit;
Error('You do not have the permission');
end;
var
myint : Integer;
}