Hi,
Problem to solve: /Get the email body as text from Report Selection- Email Body Custom Layout Description/
Process:
I extended the /Report Selection - Sales/ by adding my own option to the enum. Called /GiftCard/
I was able to add a report ID and add an Email Body Custom Layout Description with no problem. We will be using this new option in multiple companies and each company have their own email body.
When sending an email we use /EmailMessage: Codeunit /Email Message/;/ and EmailMessage.Create()
This is the most basic structure of email we can use.
We want to retrieve the Word layout from Report Selection and convert it to HTML and use that as the body.
The First option we looked at was in Report Selection (Table: 77)- Procedure GetEmailBodyTextForCust()
Which (In Short) is OnPrem and save the file path on the server and makes use of another onPrem function
REPORT.SaveAsHtml(ReportID, FilePath, RecordVariant);- Report.SaveAsHtml() is a built in function that we can't copy over
The second option we looked at was the Sales Order- Send Email, which led us to codeunit 8906 Email Editor,
Here we have the WordTemplateToTextWizard that GetsDocumentAsText(), but this procedure us also a bit confusing. We cant seem to find where the Word document is retrieved from the Report Selection. We can se that it is used in the SetBody() procedure.
This is for a SAAS client, I would like to avoid onPrem procedures or copying procedures from Base to implement.
So how does Microsoft do it in SAAS? or do they still use the OnPrem Procedures?
Thanks in advance