Hi,
While creating Sales Invoice by transferring lines to Sales invoice from Job Planning Lines The requirement is that There is a custom field Customer PO

while the user will go to transfer a line if the line has a customer Po different from the previous lines there should be an error and not allow to transfer lines.
I have created a procedure based on an event CreateLines
My code is as follows:
[EventSubscriber(ObjectType::CodeUnit, 1002, 'OnBeforeCreateSalesInvoiceLines', '', false, false)]
procedure OnBeforeCreateSalesInvoiceLines(var JobPlanningLine: Record "Job Planning Line";
InvoiceNo: Code[20];
NewInvoice: Boolean;
PostingDate: Date;
CreditMemo: Boolean)
var
customerPO: Text[50];
customerPON: Text[50];
begin
JobPlanningLine.Init();
JobPlanningLine.FindFirst;
customerPO := JobPlanningLine."WCI Description 2";
Message('1' + customerPO);
end;
but the problem is the comparison of the current record value with the previous rows customer Po is not happening.
Please help
Regards,
Indira