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++
You need to use a new code to upload the file to cloud.
Using the legacy method to upload the file would not work.
Hence you get the error that you mentioned.
FilenameOpen used to be used to get a file path, which is not what you need. You want to upload the whole file.
If simply using File::GetFileFromUser() doesn't work for you, either design a custom form or use a dialog. In either the case, the right control to use is FileUpload.
You seem to be trying to build a dialog at runtime, therefore you need code like this:
DialogGroup dialogGroup = dialog.addGroup("@SYS54759"); FormBuildControl groupControl = dialog.formBuildDesign().control(dialogGroup.name()); FileUploadBuild dialogFileUpload = groupControl.addControlEx(classstr(FileUpload), 'FileUpload'); dialogFileUpload.style(FileUploadStyle::MinimalWithFilename); dialogFileUpload.baseFileUploadStrategyClassName(classstr(FileUploadTemporaryStorageStrategy));
Use Find references on FileUpload class to find concrete examples, including various ways how you can process the result.
If you need more specific advice, you'll have to tell us what exactly you're doing (e.g. maybe you want a SysOperation dialog).
Hi Will,
Still same error is coming , no resolution by that code........
In dialog for file upload , i am using "FileOpenName" edt to upload the file , is this a problem ...........
please some other edt if exist ?
Hi Udit,
Sorry I gave you the wrong code,i have edited it, please try it again.
Not its not working still same error,..
Hi Udit,
This framework dose the job and stores your file to the temporary blob storage.
hi will.
how will it get my uploaded file , which i have uploaded in dialog field of mine ??
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 UDIT,
Please change
FileUploadResultBase result = File::GetFileFromUser();
to
FileUploadTemporaryStorageResult result = File::GetFileFromUser() as FileUploadTemporaryStorageResult;
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,900 Super User 2024 Season 2
Martin Dráb 229,275 Most Valuable Professional
nmaenpaa 101,156