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
you are already an active user of community, as you can post comments on this thread. you may create a new thread by clicking here.
or use below URL directly.
https://community.dynamics.com/ax/f/33/p/addpost?GroupToJoin=56
Yes, I realized that only after the post was created - for some reason the forum application has associated my reply with completely wrong thread, not sure how it happened. Please pardon the confusion this all has created. I've attempted to retract the post, but all I got was "access denied" - something for admins to look into..
Hi psined,
unfortunately you are on a wrong place, in the sense that this thread does not reflects any relationship to your problem. we recommend you to create a new thread/question.
In addition, when you will create thread, make sure to provide as much details as you can e.g. PCRuntimeConfigurator is not a standard AX class, so you have to explain what it is and how it looks. Kindly create a new thread.
Hi all,
Although this is an old thread, I wanted to revive it since I have pretty much the same issue and I have already tried the remedies suggested by all contributors.
Every now and then when we attempt incremental CIL build we get hailed by similar errors from standard AX code:
CIL generation: Error: .NET Cast Type Name not found. Type System.String found on the stack. This code in Class/Table: PCRuntimeConfigurator, Method: calculationSummaryEventHandler may not work in CIL run time. \Classes\PCRuntimeConfigurator\calculationSummaryEventHandler 1 calculationSummaryEventHandler Err:351
This continues to happen even after ensuring we compile using the client installed on the computer hosting the AOS and despite that the assembly Microsoft.Dynamics.AX.Xpp.Support.dll was copied from C:\Program Files\Microsoft Dynamics AX\60\Server\[AOS instance]\bin\ to C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\.
Any ideas what else might be missing?
@syed,
make sure your end-user is not posting one payment into multiple lines of journal
or user is not settling multiple invoices with one line of payment.
In those cases, it is long story than only while select.
Thank you very much for your help ievgen Miroshnikov...
Hi Syed,
Here you go while select statement syntax https://msdn.microsoft.com/en-us/library/aa558063.aspx
I think you are looking for something like
while select ledgerJournalTrans where ledgerJournalTrans.JournalNum == 'your journal number' { }
Exactly... i am not familiar with this language i just need syntax of loop in above method.
Well... does it mean that you don't know how to use X++ construct for loops, such as while select, or do you have any particular problem?
Hi Martin,
I just wanted to know that how can i loop this method to send multiple emails to those customers whose payment details are posting in a single journal which we are going to post. It is just sending one email to the top one customer.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,232 Super User 2024 Season 2
Martin Dráb 230,064 Most Valuable Professional
nmaenpaa 101,156