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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Send Emails to multiple recipients with SysEmailSystemTable by X++

(0) ShareShare
ReportReport
Posted on by 46

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");

}

I have the same question (0)
  • Abdulaziz Albloshi Profile Picture
    365 on at

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans