Solved

Send Order Report by Mail APP9

  • 5 October 2021
  • 12 replies
  • 1089 views

Userlevel 5
Badge +11

Hi,

I checked the related posts in community but, I couldn't find what I wanted.
I want to send an order report by e-mail when any process starts or continues. e.g; When the approval process for the sales quotation is completed, the quotation report will be sent to the relevant parties by e-mail.

How do I add and send order reports in email? Can anyone help?

I can generate the report with the following plsql commands, but I cannot send it as an e-mail attachment.

DECLARE
layout_name_ VARCHAR(2000) := 'OrderQuotationRep.rdl';
report_id_ VARCHAR2(2000) := 'ORDER_QUOTATION_REP';
report_attr_ VARCHAR2(2000) := '';
parameter_attr_ VARCHAR2(2000) := '';
quotation_no_ VARCHAR2(2000) := '';
line_no_ VARCHAR2(2000) := '';
rel_no_ VARCHAR2(2000) := '';

result_key_ VARCHAR2(2000);
distribution_list_ VARCHAR2(2000) := '';
print_attr_ VARCHAR2(2000) := '';

BEGIN
client_sys.add_to_attr('REPORT_ID', report_id_, report_attr_);
client_sys.add_to_attr('LAYOUT_NAME', layout_name_, report_attr_);

client_sys.add_to_attr('QUOTATION_NO', quotation_no_, parameter_attr_);
client_sys.add_to_attr('LINE_NO', line_no_, parameter_attr_);
client_sys.add_to_attr('REL_NO', rel_no_, parameter_attr_);

archive_api.new_client_report(result_key_, report_attr_, parameter_attr_, distribution_list_, print_attr_);

--command_sys.mail('IFSAPP', 'IFSADMIN', 'The order report is attached..', attach_ => attachments_, subject_ => 'Order Report Trial');

END;

 

icon

Best answer by dsj 7 October 2021, 13:46

View original

This topic has been closed for comments

12 replies

Userlevel 4
Badge +8

Hi @baris.halici,

 

Following documentation would be helpful to send the configured reports via e-mail.

http://f1web/f1docproj/apps9sp/foundation1/040_administration/250_reporting/010_operational_reporting/070_report_rules/default.htm#Send_Email

Cheers!

Userlevel 5
Badge +11

Hi @Jeewaka Padmapriya

Thanks. Report Rules are a great method; this, might help me solve my problem. 

But since I will use event action, I need to do it all in plsql. It may also be necessary to attach multiple reports to the same email.

Userlevel 7
Badge +20

Hi @baris.halici ,

 

Generation of the report PDF is an async process and you will not get the generated report pdf inside your plsql event action.

 

Once the PDF generation is completed, IFS standard event PDF_REPORT_CREATED event will be fired.

You can define the logic to send the email inside that event.

 

Cheers!

Damith

Userlevel 5
Badge +11

Hi @baris.halici ,

 

Generation of the report PDF is an async process and you will not get the generated report pdf inside your plsql event action.

 

Once the PDF generation is completed, IFS standard event PDF_REPORT_CREATED event will be fired.

You can define the logic to send the email inside that event.

 

Cheers!

Damith

Hi @dsj,

 

Thanks for answers. I knew the PDF_REPORT_CREATED event. It may also be necessary to attach multiple reports to the same email. How can I do it?

Userlevel 7
Badge +20

Hi @baris.halici ,

 

Generation of the report PDF is an async process and you will not get the generated report pdf inside your plsql event action.

 

Once the PDF generation is completed, IFS standard event PDF_REPORT_CREATED event will be fired.

You can define the logic to send the email inside that event.

 

Cheers!

Damith

Hi @dsj,

 

Thanks for answers. I knew the PDF_REPORT_CREATED event. It may also be necessary to attach multiple reports to the same email. How can I do it?

 

PDF_REPORT_CREATED event fires for each report so you’ll get one email per report :|

There could be several options to achieve your requirement. One method would be to use report rule action type Route to Connect to save the report pdfs in the IFS application server and then trigger the email afterwards (plsql action custom menu or background job using command_sys.mail) by adding each report as an attachment using the path to the file.

 

Hope it helps!

Damith

Userlevel 5
Badge +11

Hi @baris.halici,

 

Following documentation would be helpful to send the configured reports via e-mail.

http://f1web/f1docproj/apps9sp/foundation1/040_administration/250_reporting/010_operational_reporting/070_report_rules/default.htm#Send_Email

Cheers!

https://docs.ifs.com/techdocs/Foundation1/040_administration/250_operational_reporting/070_report_rules/default.htm#Action_types_and_report_rule_engine

Userlevel 5
Badge +11

Hi @dsj,

 

I am sending email successfully with report rule.

But the "semicolon" and "equals" characters are crashing the html content. Have you experienced this situation before? Can you check it?

 

e.g:

Mail Body: baris=halici or baris;halici

Mail Output Text: baris 

 

This may be because the property list is parsed with equals and semicolons. But how do you think we can solve?

 

Regards

Barış

Userlevel 5
Badge +11

It is definitely due to the following situation. I have a bigger problem. More than one email address comes in my order report; but I can't email multiple contacts as they are separated by semicolons.

 

“This may be because the property list is parsed with equals and semicolons.”

Userlevel 5
Badge +11

Hi @dsj,

I shared the details as you requested in the private message.

  1. We added 
    To: ex1@ifs.com.tr;ex2@ifs.com.tr.
    Body: <div style="color: red; font-size: 17px">baris</div>
  2. Correctly added to the "property list". but the separator characters(semicolon, equals) among themselves are scary.
  3. When I open "Action Properties" again in edit mode, we see that many data is corrupted.
  4. Worse still, the email arrived even more corrupt. Notice that the email body is directly separated from the "<div style". Because it had the equals character.

Email can be sent to more than one person, more than one person can be cc, the body can be html and css can be used. Better yet, the html data from the report can be used in the email content. 
But this situation spoils everything! :triumph::confounded:

1
2
3
4

 

Userlevel 7
Badge +20

Hi @baris.halici ,

I checked in Apps10 and it’s working as expected.

My RR with Email action

 

mail

 

HTML formatting of the email body is configured in the Setup IFS Connect → Mail sender configurations. Check if you have correct settings in the Content_Type

 

For the mail is sent only to first recipient, it could be a bug in Apps9. Better contact IFS support to further investigations.

Userlevel 5
Badge +8

@baris.halici ,

It would be more helpful for us if shared script to send order report via mail for particular condition.

I am looking same kind of scenarios.

 

Thanks in advance

 

 

 

 

Userlevel 5
Badge +11

@baris.halici ,

It would be more helpful for us if shared script to send order report via mail for particular condition.

I am looking same kind of scenarios.

 

Thanks in advance

 

Hey @Adarsh,

I sent you how the process went and the codes via private message. I hope it works for you!

 

Cheers!