while select AccountNum, TransDate,AmountMST,Invoice from vendTrans /*group by vendTrans.AccountNum*/ where vendTrans.TransDate==fromdate
{
select AccountNum ,party from vendTable where vendTable.AccountNum==vendTrans.AccountNum
join Name,RecId from partyTable where partyTable.RecId==vendTable.Party
join Locator from logisticsElectronicAddress where logisticsElectronicAddress.RecId==partyTable.PrimaryContactEmail;
str emails = logisticsElectronicAddress.Locator;
SysMailerMessageBuilder mailer = new SysMailerMessageBuilder();
mailer.setFrom(EmailParameters.SMTPUserName);
mailer.addTo(emails);
mailer.setSubject(strFmt(" Payment Details - %1 %2",vendTable.AccountNum,partyTable.Name));
body = "Hi Dear " strFmt(" %1
Vendor Account No. : %2
",partyTable.Name,vendTable.AccountNum);
body = strFmt("
We have Paid for the amount of INR : %1 /-
Please find below invoice wise details for this payment done on : %2
",vendTrans.AmountMST, vendTrans.TransDate);
while select AccountNum,TransDate,SettleAmountMST from vendSettlement
where vendSettlement.TransRecId==vendTrans.RecId
{
body = strFmt("
External Document No. %1 Invoice Amount : %2 /-
",vendtrans.Invoice, vendSettlement.SettleAmountMST);
}
//body = "Hi, " strFmt(" Dear %1,
We have Paid for the amount of INR : %2 /-
Please find below invoice wise details for this payment done on : %3
External Document No. %4 Invoice Amount : %5 /-
We Thankyou for choosing Bisleri and take pride in having you as our partner.
Assuring you of our Best services at all times
",partyTable.Name,vendTrans.AmountMST,vendTrans.TransDate);//,vendTrans.Invoice,vendSettlement.SettleAmountMST) ;
body = strFmt("
We Thankyou for choosing and take pride in having you as our partner.
Assuring you of our Best services at all times
");
localAccount = vendTable.AccountNum;
mailer.setBody(body,true) ;
SysMailerFactory::getNonInteractiveMailer().sendNonInteractive(mailer.getMessage()) ;
}
the second while is used to printing multiple invoice amounts and invoice numbers like this, so how can this error be removed. Please help or optimize code so it can be removed Thankyouuuuu