Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to Auto fill email subject and email id while sending the report in Ax 2009?

Posted on by 925

Hi Everyone,

In ax 2009, for eg, I open the Invoice Specification Report from AP module, now when i want to send email of this report, the TO address and the subject should be filled automatically.

In this case,

To          --> Email Id from VendTable

Subject --> Invoice Specfication

Is this possible? If it is , what class i have too see? or do i have to create one?

Pls Advice

*This post is locked for comments

  • ThivaKar Profile Picture
    ThivaKar 925 on at
    RE: How to Auto fill email subject and email id while sending the report in Ax 2009?

    Thanks dan for your time! :)

  • Suggested answer
    Dan Emreus Profile Picture
    Dan Emreus 1,162 on at
    RE: How to Auto fill email subject and email id while sending the report in Ax 2009?

    Hi again,

    If you write something like this in purcheditlines form on the clicked method for the button PrintFormLetter it should work.

       PrintJobSettings    printJobSettings;

       ;

       super();

       printJobSettings = new PrintJobSettings(purchFormLetter.printerSettingsFormletter(PrintSetupOriginalCopy::Original));

       printJobSettings.mailTo(VendTable::find(PurchParmTable.OrderAccount).Email);

       printJobSettings.mailSubject("Invoice specification");

       printJobSettings.printerSettings(formstr(SysPrintForm));

       PurchFormLetter.updatePrinterSettingsFormLetter(printJobSettings.packPrintJobSettings(), PrintSetupOriginalCopy::Original);

    Hope this helps.

    /Dan

  • ThivaKar Profile Picture
    ThivaKar 925 on at
    RE: How to Auto fill email subject and email id while sending the report in Ax 2009?

    Hi Dan, im using

    PurchFormLetter class  ,callPrintersettingsFormletter() method i have given this code before the //ok = printJobSettings.printerSettings(formstr(SysPrintForm));//

    printJobSettings.mailTo(VendTable::find(PurchParmTable.OrderAccount).Email);

    printJobSettings.mailSubject("Purchase Order");

    printJobSettings.preferredMailFormat(PrintFormat::PDF);

    Here there is no argument for the PurchParmTable , so in this case what i have to do?

  • Suggested answer
    Dan Emreus Profile Picture
    Dan Emreus 1,162 on at
    RE: How to Auto fill email subject and email id while sending the report in Ax 2009?

    Depending on where you are in the code you probably can use this.

    VendTable::find(PurchParmTable.OrderAccount).Email

    Hope this helps!

    /Dan

  • ThivaKar Profile Picture
    ThivaKar 925 on at
    RE: How to Auto fill email subject and email id while sending the report in Ax 2009?

    Hi Dan,

    Actually i achieved my requirement with the help of printJobsettings class

    printJobsettings.mailTo(...);

    Now all i need is the logic for finding the current purch order vendor email id to pass in printJobsettings.mailTo(// current purch order vendor email id );

  • Suggested answer
    Dan Emreus Profile Picture
    Dan Emreus 1,162 on at
    RE: How to Auto fill email subject and email id while sending the report in Ax 2009?

    I should create a new class for this and send in the purchase order as argument.

    /Dan

  • ThivaKar Profile Picture
    ThivaKar 925 on at
    RE: How to Auto fill email subject and email id while sending the report in Ax 2009?

    and by adding logic for posting purchase order is in?? Class ? or just a job?

  • Suggested answer
    Dan Emreus Profile Picture
    Dan Emreus 1,162 on at
    RE: How to Auto fill email subject and email id while sending the report in Ax 2009?

    Hi again,

    I do not think this is the right approach it is a little to complicated. It is better to create a new button for posting purchase order that is enabled only if the vendor has a mail-address. And if clicked you can add logic for posting purchase order by x++ and then send it by mail.

    /Dan

  • ThivaKar Profile Picture
    ThivaKar 925 on at
    RE: How to Auto fill email subject and email id while sending the report in Ax 2009?

    Hi dan , to be clear .

    when i post the purchase order . in purcheditlines form , when i select print format as email from the sendto list  the TO address should be automatically filled. Pls advice

  • ThivaKar Profile Picture
    ThivaKar 925 on at
    RE: How to Auto fill email subject and email id while sending the report in Ax 2009?

    mail-address and subject should be automatically filled for the purchase order. that is my requirment. the stringedit To and Subject from the SysPrintForm should be auto filled when i select print format as 'email'. i have to code it to gets auto-filled. so pls advice on coding

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans