...
PaymentHistoryLine.RESET;
PaymentHistoryLine.SETCURRENTKEY("Our Bank",Status,"Run No.",Order,Date);
PaymentHistoryLine.SETRANGE("Our Bank","Payment History"."Our Bank");
PaymentHistoryLine.SETRANGE("Run No.","Payment History"."Run No.");
// Delete the following line.
AddElement(XMLNodeCurr,'NbOfTxs',FORMAT(PaymentHistoryLine.COUNT,15,9),'', XMLNewChild);
PaymentHistoryLine.CALCSUMS(Amount);
AddElement(XMLNodeCurr,'CtrlSum',FORMAT(PaymentHistoryLine.Amount,18,9),'', XMLNewChild);
AddElement(XMLNodeCurr,'Grpg','SNGL','', XMLNewChild);
AddElement(XMLNodeCurr,'InitgPty','','', XMLNewChild);
XMLNodeCurr := XMLNewChild;
...
...
PaymentHistoryLine.RESET;
PaymentHistoryLine.SETCURRENTKEY("Our Bank",Status,"Run No.",Order,Date);
PaymentHistoryLine.SETRANGE("Our Bank","Payment History"."Our Bank");
PaymentHistoryLine.SETRANGE("Run No.","Payment History"."Run No.");
// Add the following line.
AddElement(XMLNodeCurr,'NbOfTxs',DELCHR(FORMAT(PaymentHistoryLine.COUNT,15,9),'=',' '),'', XMLNewChild);
PaymentHistoryLine.CALCSUMS(Amount);
AddElement(XMLNodeCurr,'CtrlSum',FORMAT(PaymentHistoryLine.Amount,18,9),'', XMLNewChild);
AddElement(XMLNodeCurr,'Grpg','SNGL','', XMLNewChild);
AddElement(XMLNodeCurr,'InitgPty','','', XMLNewChild);
XMLNodeCurr := XMLNewChild;
...