if there is records with same recid from CustInvoiveJour and SalesTable...
Missing line in SalesInvoice (PurchInvoice,ProjInvoice) - fetch method
X++:
while select custPaymSched
where
custPaymSched.ExtTableId == custInvoiceJour.TableId && //Missing line
custPaymSched.ExtRecId == custInvoiceJour.RecId