web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

List of customers with email-invoice

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    you can see this information in email sent history of system administration

  • Community Member Profile Picture
    on at

    Hi Sohaib

    You mean in AX or in Outlook?

    If in AX, where is it I can find it?

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    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

  • Community Member Profile Picture
    on at

    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.

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    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

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    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

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Sohaib

    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)));
        }
    }
  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    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"

  • Community Member Profile Picture
    on at

    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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans