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

How to add a new filed under "Print destination settings"

(2) ShareShare
ReportReport
Posted on by 132
I have added a customized filed (Sender mail) into the "Print destination settings" under the "Email" tab.
 
 
How can I save this value to access this from the report?
Below is the code set I have tried, but it doesn't work. I am not sure that I have used pack and unpack methods correctly. 
 
Extension class for "SrsReportEMailDataContract" class - To set the data member attribute for "emailFrom"
[ExtensionOf(classStr(SrsReportEMailDataContract))]
final class SrsReportEMailDataContract_Extension
{
    private str emailFrom;

    [DataMemberAttribute]
    public str parmFrom(str _value = emailFrom)
    {
        emailFrom = _value;
        return emailFrom;
    }

}
 
 
Extension class for "SRSPrintDestinationSettings" class
[ExtensionOf(classStr(SRSPrintDestinationSettings))]
final class SRSPrintDestinationSettings_Extension
{
    #define.version(6)
    #define.packVersion(6)
    #localmacro.currentList
        emailFrom
    #endmacro

    private str emailFrom;

    [DataMemberAttribute]
    public str emailFrom(str _value = emailFrom)
    {
        emailFrom = _value;
        return emailFrom;
    }

    public SrsReportEMailDataContract parmEMailContract(SrsReportEMailDataContract _emailContract)
    {
        SrsReportEMailDataContract emailContractExt = next parmEMailContract(_emailContract);
        
        if (!emailContractExt)
        {
            emailContractExt.parmFrom(this.emailFrom));
        }

        return emailContractExt;
    }

}
 
Extension class for "SRSPrintDestinationSettingsForm" from
​
[ExtensionOf(formStr(SRSPrintDestinationSettingsForm))]
final class SRSPrintDestinationSettingsForm_Extension
{
    public void closeOk()
    {
        this.closeOk_ABC();

        next closeOk();
    }

    private void closeOk_ABC()
    {
        FormRun formRun = this as FormRun;

        SRSPrintDestinationSettings printSettingsExt = new SRSPrintDestinationSettings(formRun.printDestinationSettings().pack());
        FormStringControl senderEmailControl = formRun.design().ControlName(formControlStr(SRSPrintDestinationSettingsForm, MailFrom));

        if (senderEmailControl != null)
        {
            printSettingsExt.emailFrom(senderEmailControl.text());
        }

        formRun.printDestinationSettings().unpack(printSettingsExt.pack());
    }

    public void init()
    {
        next init();

        this.init_ABC();
    }

    private void init_ABC()
    {
        FormRun formRun = this as FormRun;

        container   printSettingsPackExt = formRun.printDestinationSettings().pack();

        SRSPrintDestinationSettings printSettingsExt = new SRSPrintDestinationSettings(printSettingsPackExt);

        FormStringControl senderEmailControl = formRun.design().ControlName(formControlStr(SRSPrintDestinationSettingsForm, MailFrom));
        senderEmailControl.text(printSettingsExt.emailFrom());
    }

}

​
Could anyone help me on this?

 
Categories:
I have the same question (0)

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 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans