Skip to main content
Solved

Send Order Report by Mail APP9


baris.halici
Hero (Customer)
Forum|alt.badge.img+12

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;

 

Best answer by dsj

baris.halici wrote:
dsj wrote:

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

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

12 replies

Jeewaka Padmapriya
Hero (Employee)
Forum|alt.badge.img+8

baris.halici
Hero (Customer)
Forum|alt.badge.img+12
  • Author
  • Hero (Customer)
  • 127 replies
  • October 6, 2021

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.


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 857 replies
  • October 7, 2021

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


baris.halici
Hero (Customer)
Forum|alt.badge.img+12
  • Author
  • Hero (Customer)
  • 127 replies
  • October 7, 2021
dsj wrote:

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?


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 857 replies
  • Answer
  • October 7, 2021
baris.halici wrote:
dsj wrote:

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


baris.halici
Hero (Customer)
Forum|alt.badge.img+12
  • Author
  • Hero (Customer)
  • 127 replies
  • October 8, 2021

baris.halici
Hero (Customer)
Forum|alt.badge.img+12
  • Author
  • Hero (Customer)
  • 127 replies
  • October 20, 2021

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ış


baris.halici
Hero (Customer)
Forum|alt.badge.img+12
  • Author
  • Hero (Customer)
  • 127 replies
  • October 20, 2021

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.”


baris.halici
Hero (Customer)
Forum|alt.badge.img+12
  • Author
  • Hero (Customer)
  • 127 replies
  • October 25, 2021

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

 


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 857 replies
  • October 25, 2021

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.


Forum|alt.badge.img+8
  • Sidekick
  • 79 replies
  • January 6, 2022

@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

 

 

 

 


baris.halici
Hero (Customer)
Forum|alt.badge.img+12
  • Author
  • Hero (Customer)
  • 127 replies
  • January 11, 2022
Adarsh wrote:

@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!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings