Solved

Send Mail Automatically

  • 17 June 2022
  • 4 replies
  • 781 views

Badge +8

Hi All,

 

When the Customer wants to return goods via email, can we set it up automatically instead of doing RMB and the ‘Print supplier Returns’ option? Refer to the below attachment. when the customer has to return items to the supplier, they want to send an email automatically. I created a custom event action for it, but need further ideas on how to do that. Appreciate your support

Thanks

Saradha

icon

Best answer by mwilson 20 June 2022, 14:50

View original

4 replies

Userlevel 3
Badge +10

Is this the SUPPLIER_SHIPMENT_RETURN_REP report?

Userlevel 3
Badge +10

Did you create the event on ReceiptReturn?  If so, I don’t understand the issue.  You can create an action of type E-Mail what is the problem?  Are you in need of help looking up the supplier email address?  Are you perhaps looking to add the report, in which case you will have to trigger it off of the archive_tab instead and check for the report id.

Badge +8

Hi @mwilson ,

 

I created a custom event action but it didn't work.No idea to proceed further. The problem is when the customer has to return items to the supplier, they want to send an email automatically to the supplier without doing the RMB -->Print supplier Returns option.

This is the SUPPLIER_SHIPMENT_RETURN_REP report. Do you have any idea how to do that one with custom events or other functions(Ex: report Rule)?

Thank You

Userlevel 3
Badge +10

What the user wants and what the user can have can sometimes be very different.  Generating the report is no small undertaking.  The user has just made the task three times harder than if they just trigger off of the report creation.  I guarantee that sometime in the first 6 months of you doing it this way that someone has a problem where they make a change that did not get on the report.  With that in mind here goes.

You need a few things before you begin.  First, you need to identify who this email is to be sent to.  To do that you need the supplier communication methods filled out.  And not just filled out you need to identify a standard address id where this method will be stored because you can have more than one email address on a supplier.

Identify and create a standard address id where on each supplier you will store a default email address. 

You need to identify what email address this is from so that they have an address they can reply to with problems.

You need someone with intermediate skills with PL/SQL.

Next you create a custom event on the receipt_info_tab table.  Check the box for Objects are changed.  Click on the Only when these attributes are changed.  Select rowstate.  Now make sure to check the SOURCE_REF columns in case you need this for your email.  Also select Sender, sender_type, and Rowstate.  In all cases select the NewValue.

You will need to create a custom Attribute to get the email address.  The function call will be something like this.

Comm_Method_API.Get_Default_Value(&NEW :SENDER_TYPE,

                                      &NEW :SENDER,

                                      'E_MAIL',

                                      Comm_Method_API.Get_Default_Address_Id(&NEW :SENDER,

                                                                             'E_MAIL',

                                                                             &NEW :SENDER_TYPE,

                                                                             'THE TYPE YOU SET Up'))

 

Now you have the event setup.  Now is where it starts to get interesting.  The action is going to be Execute Online SQL.  Add a condition for when Rowstate equals Released.  From here you are going to do the work because I do not have the time to explain all of the finer details.

You need to create an anonymous block of code that first generates the report and then generates an email with the report as an attachment.  This gets into several more involved and advanced details which is why I will not be explaining it here, I just don’t have the time.

You need to look for the package that generates the report.  I always start at report_sys and try to find my way through.  You may also have to look at the print job packages.

In all of that there should also be examples of IFS talking back to or submitting jobs that run on the application server that can send emails.  You can piggyback on that if you are not fussy about email body content.  Or you can use IFS package for sending emails or go the longer route and learn how to use the oracle UTL_SMTP package.

 

Option two, make the triggering event be the printing of the report.  This is easier because you don’t have to reinvent the wheel.  You can create an event action on the Application defined event, PDF_REPORT_CREATED.  In the action E-Mail add a condition for the REPORT_TITLE to match the report you are generating. Now all you have to do is figure out how to get the correct email address populated in the PDF_PARAMETER_1.

Reply