trigger OnValidate()
var
StatusLbl: Label 'The status of the policy has changed to: %1', Comment = '"ESP = "El estado de la póliza ha cambiado a: %1"';
begin
Rec.Reset();
// --- IF para comprobar si el estado de la póliza es Aceptada o Rechazada ---
if (("Policy Status" = "Policy Status"::Approved) OR ("Policy Status" = "Policy Status"::Rejected)) then
Message(StrSubstNo(StatusLbl, "Policy Status"));
Rec."Accep. Reject. Date" := Today();
Rec.Modify(false);
end;
This is my code. I want to not allow to modify antithing of the record if I enter in the IF section. How can I do it?
0
Answers
Instead of using a Message, use an Error.
PS: for both Message and Error, you don't need to use StrSubstNo.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
if (("Policy Status" = "Policy Status"::Approved) OR ("Policy Status" = "Policy Status"::Rejected)) then begin
Message(StrSubstNo(StatusLbl, "Policy Status"));
Rec."Accep. Reject. Date" := Today();
Rec.Modify(false);
end;