Hi All,
I have a problem where I have to check whether the Purchase Line records have job no. or Job Task no. in the subform when I open a purchase order.
If any one row has a blank job no. field or a blank job task no. field I will have to Error message on click of release
I am using the following code:
modify(Release)
{
trigger OnBeforeAction()
begin
BeforeRelease();
end;
}
}
procedure BeforeRelease()
var
PurchaseLine: Record "Purchase Line";
PurchHeader: Record "Purchase Header";
OldDescription: Text;
begin
PurchaseLine.SetRange("Document Type", PurchHeader."Document Type");
PurchaseLine.SetRange("Document No.", PurchHeader."No.");
if PurchaseLine.FindSet then begin
repeat
PurchaseLine.Init();
PurchaseLine.Copy(PurchaseLine);
if PurchaseLine."Job No." = OldDescription then begin
Error('hhhh');
end;
until PurchaseLine.Next = 0;
end;
end;
The above code is not fetching any value of the Purchase lines .not sure why.
Please help.Attached is a screenshot
