I want to send any type of file such as excel, text , etc in attachment when sending mail through x++ ,which i will upload in the dialog box using edt "FILENAMEOPEN"...
That means i will upload my file in dialog box , and want to send that attachment through email in x++
All right, and which part do you need our help with?
A trivial implementation could be something like this:
FileUploadResultBase result = File::GetFileFromUser(); if (result.getUploadStatus()) { SysMailerMessageBuilder builder = new SysMailerMessageBuilder(); builder.addTo(...); builder.addAttachment(result.openResult(), result.getFileName()); SysMailerFactory::sendInteractive(builder.getMessage()); }
hello Martin,
I am getting this error when i am selecting the file to upload
"The FileUpload Strategy Class you selected does not exist"??
As well as the code is below -:
dialogfieldfile = dialog.addField(extendedTypeStr(FilenameOpen),"File Selector");
FileUploadResultBase result = File::GetFileFromUser();
if (result.getUploadStatus())
{
builder.addTo(getvalue);
builder.setFrom(sysEmailParameters.SMTPUserName);
builder.addCc(cc);
builder.addAttachment(result.openResult(), result.getFileName());
}
probably you would want to have a look at new way of uploading files. as the same app is used in cloud now, as well for on-prem, therefore legacy code cannot be used as in old days. please have a look at next discussion.
community.dynamics.com/.../812848
Hi UDIT,
Please change
to
FileUploadTemporaryStorageResult result = File::GetFileFromUser() as FileUploadTemporaryStorageResult;
I am having this requirement , on dialog i have 3 fields in which on one filed i need to upload the file and send it as attachment
hi will.
how will it get my uploaded file , which i have uploaded in dialog field of mine ??
Hi Udit,
This framework dose the job and stores your file to the temporary blob storage.
Not its not working still same error,..
Sorry I gave you the wrong code,i have edited it, please try it again.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 683 Most Valuable Professional
André Arnaud de Cal... 563 Super User 2025 Season 2
Sohaib Cheema 398 User Group Leader