Notifications
Announcements
No record found.
Hi I want to retrieve the list of our customers who gets email-invoices.
Which tables should I look at?
/Mahyar
*This post is locked for comments
you can see this information in email sent history of system administration
Hi Sohaib
You mean in AX or in Outlook?
If in AX, where is it I can find it?
I am not sure how you are sending emails.
for ax sent emails you can find history at System administration/periodic/Email Processing/Email Sending History
I try following job, but I get error.
static void findEmailCustomers(Args _args) { CustTable custTable; PrintMgmtDocInstance printMgmtDocInstance; PrintMgmtSettings printMgmtSettings; PrintjobSettings printjobSettings; while select custTable join printMgmtDocInstance where printMgmtDocInstance.DocumentType == PrintMgmtDocumentType::SalesOrderInvoice && printMgmtDocInstance.ReferencedTableId == custTable.TableId && printMgmtDocInstance.ReferencedRecId == custTable.RecId join printMgmtSettings where printMgmtSettings.ParentId == printMgmtDocInstance.RecId { if (printMgmtSettings) { printJobSettings = new PrintJobSettings(printMgmtSettings.PrintJobSettings); print strFmt('%1', printjobSettings.getTarget()); break; if (printJobSettings.getTarget() == PrintMedium::Mail) { info(strFmt('Kunde: %1, Email: %2', custTable.AccountNum, PrintJobSettings.to())); break; } } } }
Errormessage:
OpenPrinter_1: rc:0 lastError:1722(0x6ba) The RPC server is unavailable.
all the objects (tables, classes) which you are using above are for "Print Setting"
these are not for log of sent emails. so it will not work. you cannot get any output from these objects about what was sent as email
emails logs which are sent via ax is under system administration
But let me add here one very important point that this email log which has been provided in system administration module of ax, it has been developed Generalized.
It is not specifically for customer invoice sending ect
for your past record which have been sent already you can do effort of manual verification by going to email logs
for future, if you want to keep some specific reference, while emails is sent for customer invoice, you can customize behavior so that it will keep additional information in email sent log/table.
SysOutgoingEmailTable is not keeping any RefRecId that against which record it has sent email. This happens In notification EventInbox but not in Sent Email Log
I tried this job, and that gave me the right list of which customers are email customer or not.
static void findEmailAddresses(Args _args) { CustTable custTable; PrintMgmtDocInstance printMgmtDocInstance; PrintMgmtSettings printMgmtSettings; PrintJobSettings printJobSettings; info(strFmt(";Kunde;DocType;Target;To;Filetype;Path;Filetype2")); while select custTable join printMgmtDocInstance where printMgmtDocInstance.ReferencedTableId == custTable.TableId && printMgmtDocInstance.ReferencedRecId == custTable.RecId join printMgmtSettings where printMgmtSettings.ParentId == PrintMgmtDocInstance.RecId { info(strFmt(";%1;%2;%3;%4;%5;%6;%7", custTable.AccountNum, printMgmtDocInstance.DocumentType, conPeek(printMgmtSettings.PrintJobSettings, 3), conPeek(printMgmtSettings.PrintJobSettings, 15), conPeek(printMgmtSettings.PrintJobSettings, 18), conPeek(printMgmtSettings.PrintJobSettings, 20), conPeek(printMgmtSettings.PrintJobSettings, 21))); } }
I see.
so you was looking for "list of customer which has been setup in print management for any reason"
I was mistaken as I though you are looking for "email history of customers as report is sent to them"
Thats right, I was looking for customer with "email" in print management :)
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2