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 :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

change in Subject of email with sales order confirmation

(0) ShareShare
ReportReport
Posted on by 72
Hello Experts,

we have client requirement the subject in email for SO confirmation to include customer/order reference and SO number below the the format of the subject in email 
Can some help me, how to make change to subject of email for SO confirmation

 
 the format of subject of email in SO confirmation
-"Sales Confirmation: SO078936 / Your reference: P2610240"

SO number=SO ID
your reference= customer Requisition


I have the same question (0)
  • Suggested answer
    Navneeth Nagrajan Profile Picture
    2,618 Super User 2026 Season 1 on at
     
    A few questions:
    1. Is customer requisition a custom field in this case?
     
    Suggestions:
    if you are using the SalesConfirmation report and setting up the Print Management destination settings then you can extend the SalesConfirmController class. Below is a code snippet for the same. I have excluded Customer requisition because it looks like a custom field to me and i am not sure about the data source (SalesHeader or SalesLine etc.). Leave the subject line blank and the fields will automatically populate in the desired format when the Medium is an email. 
     
     
    [ExtensionOf(classStr(SalesConfirmController))]
    final class SalesConfirmController_Extension
    {
        protected void preRunModifyContract()
        {
            next preRunModifyContract();
     
            //Call the SRSPrintDestinationSettings base class
            SRSPrintDestinationSettings destinationSettings = 
                this.parmReportContract().parmPrintSettings().parmPrintDestinationSettings();
            if (destinationSettings && destinationSettings.parmPrintDestination() == PrintMedium::Email)
            {
                SalesConfirmContract contract = this.parmReportContract() as SalesConfirmContract;

                SalesTable salesTable = SalesTable::find(contract.parmSalesId());
                if (salesTable)
                {
                    str subjDetails = strFmt("Sales Confirmation: %1 / Customer : %2",
    // Reference Number: %3",
                                               salesTable.SalesId,
                                               salesTable.custAccount);
                    destinationSettings.emailSubject(subjDetails);
                }
            }
        }
    }
     
    Hope this helps. Happy to answer questions, if any.
  • Suggested answer
    Subra Profile Picture
    849 on at
    Hi 

    Please extend your controller class and add the below changes in your class

    protected void preRunModifyContract()
    {
    next preRunModifyContract();

    SrsReportEMailDataContract emailContract;

    if (this.parmReportContract().parmPrintSettings().printMediumType() == SRSPrintMediumType::Email)
    {
    emailContract = this.parmReportContract().parmEMailContract();

    if (emailContract)
    {
    SalesTable salesTable = this.parmArgs().record();

    str subject = strFmt(
    "Invoice %1 | %2",
    salesTable.SalesId,
    salesTable.CustAccount
    );

    emailContract.parmSubject(subject);
    }
    }
    }

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 April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 139 Super User 2026 Season 1

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 110 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 92 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans