Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Send Emails to multiple recipients with SysEmailSystemTable by X++

(0) ShareShare
ReportReport
Posted on by 44

This Post is in duplicated sorry. Here the right one

Hi all,

I am kinda new with batch processing and emails, so I would like you guys to give me a hand with this.

I have a code that calculates the prices of production against the sales orders. If the Productions costs > Sales order then pulls a trigger by code and send Email to specifics recipients.

I have configurated the basics stuff like email parameters and templates. And my code is actually sending the emails into the waiting stack ( ) . but only sends the actual email only if I pressed the ok button in the batch job. where Do I configure it in order to send emails directly after the trigger is pulled (just at the moment the code sends the email).

also How Do I sent to multiple recipients using the SysEmailSystemTable::sendMail()

here the code

static void AKS_NC_PreCalculate_Emails(Args _args)
{
    SysEmailTable   sysEmailTable;
    SysEmailSystemTable sysEmailSysTable;
    Map             mappings        = new Map(Types::String, Types::String);
    List            recipients;
    // str             xml;
    ;

    // Build your variable/text mappings
    mappings.insert('show_info', 'Here the Info body on the Mail ');

    //sysEmailSysTable = sysEmailSysTable::find('ProdCost');
    sysEmailSysTable =SysEmailSystemTable::find('ProdCost');

    
    SysEmailSystemTable::sendMail(sysEmailSysTable.EmailId,
                            'en-gb', // Chosen language
                            "", // Who you're sending the email to
                            mappings, // Your variable mappings
                            '', // Location of file attachment (server/client matters) or none
                            '' , // XML if you're using XSLT
                            true, // Traceable or not?
                            'Nestor', // Sending user
                            true); // Use retries?

    info("email Sent");

}

  • Abdulaziz Albloshi Profile Picture
    Abdulaziz Albloshi 365 on at
    RE: Send Emails to multiple recipients with SysEmailSystemTable by X++ AX2012

    you have to set recurrence on the batch job so it run periodically. also Email sending has its own batch job so check the recurrence of that batch job too.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,187 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,966 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans