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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Change attachement fil...
Finance forum

Change attachement file name when email statement or invoice to customer

(0) ShareShare
ReportReport
Posted on by 1,243

Hi All,

We had successfully configured using print management to email invoice or statement to customer. However the attachment file name does not in proper naming convention.

Does anyone know how to change the attachment file name when email statement or invoice to the customer?

Thanks.

Regards,

Teh

I have the same question (0)
  • Jie G Profile Picture
    Microsoft Employee on at

    You can refer to the following similar reference:

      ax.docentric.com/email-reports-customized-body-additional-attachments

  • Venedict Profile Picture
    1,243 on at

    Hi,

    Seem like that's installed with 3rd party solution, is that meant without 3rd party tools, the attachment name is unchangeable or configurable?

    Thanks.

    Regards,

    Teh

  • Suggested answer
    ShahTanuj Profile Picture
    330 on at

    Hi,

    You can refer below code for renaming the attachment file name.

    Note : Here i am takign dialog caption as the new file name you can change it as per your requirement.

    printSettings = formLetterReport.getCurrentPrintSetting().parmPrintJobSettings();

                  filenameLoc = printSettings.fileName(); //taking the attachment file name

                   if(filenameLoc)

                     {

                         //getting the directory path based on the file name

                     directory = System.IO.Path::GetDirectoryName(filenameLoc);

                          //Combining the dialog caption and directory)

                     filenameFinal = System.IO.Path::Combine(directory,strFmt("%1.%2",this.parmDialogCaption(),printSettings.fileFormat()));

                        //checking if file exists with the file name then overriding , creating if it doesnt exist.

                        if(!WinAPI::fileExists(filenameFinal))

                       {

                           WinAPI::createFile(filenameFinal);

                           printSettings.fileName(filenameFinal);

                       }

                       else

                       {

                           printSettings.fileName(filenameFinal);

                      }

                   }

    Thanks

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans