trigger OnInsertRecord(BelowxRec: Boolean): Boolean
var
TableNumber: Integer;
POProformaWarning: Notification;
POProformaWarningLbl: Label 'Shipping to PROFORMA customer; DO NOT send PO before payment confirmation!';
CustRecRef: RecordRef;
CustFieldRef: FieldRef;
PrepaymentCodeRef: Code[20];
begin
if (Rec."Sell-to Customer No." <> '') then begin
TableNumber := Rec.Relation("Sell-to Customer No.");
CustRecRef.Open(TableNumber);
CustFieldRef := CustRecRef.Field(27);
Evaluate(PrepaymentCodeRef, CustFieldRef.Value);
if PrepaymentCodeRef = 'PREPAYMENT' then begin
POProformaWarning.MESSAGE(POProformaWarningLbl);
POProformaWarning.SCOPE := NotificationScope::LocalScope;
POProformaWarning.Send();
end;
end;
end;