Dear Experts,
I am new in X++, I wrote a clicked method on the post button of LedgerJournalTransCustPaym form, my method is sending email to top one customer in payment journal not all the customers who are exist in the same journal. I want to send emails to all the customers who's payment is received in the journal which we are going to post. help required, clicked method is giving below.
void clicked()
{
SysEmailId sysEmailId = 'PayEmail';
str recipientEmail = "erpadmin@test.com";
CustTable custTable;
Map mappings;
;
super();
custTable = LedgerJournalTrans.findCustTable();
recipientEmail = custTable.email();
mappings = new Map(Types::String, Types::String);
mappings.insert('CustomerName', custTable.name());
mappings.insert('InvoiceNo',LedgerJournalTrans.MarkedInvoice );
mappings.insert('EntryDate',LedgerJournalTrans.TransDate );
mappings.insert('Amount', LedgerJournalTrans.AmountCurCredit);
SysEmailTable::sendMail(
sysEmailId,
SysEmailTable::find(sysEmailId).DefaultLanguage,
recipientEmail,
mappings,
'',
'',
true,
curUserId(),
true);
}
Thanks in advance.
-Aamir Raza
*This post is locked for comments