After Purchase Order is released, some fields cannot be changed but some fields are allowed to change. EX: Transaction Type
How to customize to show the error when User tries to change this field value while the Purchase Order status is released ?
Just make sure that if you are using other purchase documents like Invoice or Return Order etc. and transaction type field then also the error message will show as "PO is released".
Thanks Yadav.
Your way can work.
I tried another way to show the detail message
modify("Transaction Type")
{
trigger OnBeforeValidate()
begin
if (rec.Status = rec.Status::Released) then begin
//Rec.Testfield(Status, rec.Status::Open);
error('You can not change this field after PO is released');
end;
end;
}
Separate Error message is not required
Just Rec.Testfield(Status,rec.Status::Open); is enough or TestStatusOpen();
Thanks Nitin, Yadav
Is it the below code correct:
tableextension 50110 "TLC Purchase Hdr. Ext" extends "Purchase Header"
{
fields
{
// Add changes to table fields here
field(50110; "Deposit Date"; Date)
{
Caption = 'Deposit Date';
DataClassification = CustomerContent;
}
modify("Transaction Type")
{
trigger OnBeforeValidate()
begin
Rec.Testfield(Status,rec.Status::Open);
error('You can not change this field after PO is released');
end;
}
}
}
Use OnBeforeValidate trigger and standard function TestStatusOpen();
Hi,
You can customize the solution OnBeforeValidate of this field and put below code
Rec.Testfield(Status,rec.Status::Open);
Thanks.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156