We are using IFS Applications 8. I would like to automatically send an email when the expiration date of certain products is less than 60 days away.
We have already developed a PL/SQL procedure that queries this data. Now, we want this procedure to be triggered every day at 8 PM. If the procedure returns any results, an email should be sent to the relevant recipients.
We are considering a few approaches such as:
Scheduling the procedure using Database Task or Scheduled ReportT
Trigger an existing Event Action
Could you please advise which of these is more appropriate or commonly used in IFS8 for similar automation? We want to make sure we’re aligning with IFS standards as much as possible.
Thanks in advance!
PROCEDURE Send_Expiry_Alert_364_365 IS v_message VARCHAR2(32767); BEGIN v_message := 'The expiration date of the following products will be within 60 days:' || CHR(10);
FOR rec IN ( SELECT part_no, ifsapp.inventory_part_api.get_description(contract, part_no) AS descp, expiration_date FROM ifsapp.inventory_part_in_stock WHERE part_no IN ('SRF0-000000364', 'SRF0-000000365') AND expiration_date IS NOT NULL AND expiration_date <= TRUNC(SYSDATE) + 60 ) LOOP v_message := v_message || CHR(10) || '- ' || rec.part_no || ' | ' || rec.descp || ' | Son K.T: ' || TO_CHAR(rec.expiration_date, 'DD.MM.YYYY'); END LOOP;
/* Client_SYS.Add_Info(v_message);*/ END Send_Expiry_Alert_364_365;
Page 1 / 1
Hi @sahango I would say Scheduled Report.
The scheduled report would be easier, as it doesn't require further event creation or database items.
Hello @sahango ,
We recommend using a Database Task and schedule it for this kind of automation. Here's why:
It’s fully supported in IFS Applications 8 and commonly used for scheduled tasks.
It works well when you need to run a PL/SQL procedure at a specific time, like your 8 PM daily job.
It’s easy to set up and monitor through the IFS Background Job window — you can track when it runs and whether it completes successfully.
This approach avoids the complexity of setting up Event Actions, which are better suited for real-time, event-based triggers (like reacting to data changes immediately).
Thanks, Hardik
Hi @sahango I would say Scheduled Report.
The scheduled report would be easier, as it doesn't require further event creation or database items.
Thanx for quick response. Where should I create this report? The 'New' button is disabled under the Report Definitions section.
Hi @sahango I would say Scheduled Report.
The scheduled report would be easier, as it doesn't require further event creation or database items.
Thanx for quick response. Where should I create this report? The 'New' button is disabled under the Report Definitions section.
Ignore me @sahango, I was thinking of a totally different concept. @hardik details the alternative.
Hello @sahango ,
We recommend using a Database Task and schedule it for this kind of automation. Here's why:
It’s fully supported in IFS Applications 8 and commonly used for scheduled tasks.
It works well when you need to run a PL/SQL procedure at a specific time, like your 8 PM daily job.
It’s easy to set up and monitor through the IFS Background Job window — you can track when it runs and whether it completes successfully.
This approach avoids the complexity of setting up Event Actions, which are better suited for real-time, event-based triggers (like reacting to data changes immediately).
Thanks, Hardik
ITahnx for concerning. I created a New Database Task and then a Database Task Schedule. However, I’m not exactly sure how to handle the e-mail sending part. Where and how should I configure the e-mail delivery for this task?
@sahango Update your procedure to send an email and either you can hardcode the recipients email id or you can You can create a simple table to store recipient email addresses,
Make sure:
The COMMAND_SYS.Mail email function works in your IFS.
Email (SMTP) settings are already set up in your system.
@sahango Update your procedure to send an email and either you can hardcode the recipients email id or you can You can create a simple table to store recipient email addresses,
Make sure:
The COMMAND_SYS.Mail email function works in your IFS.
Email (SMTP) settings are already set up in your system.
Thank you, I added the related function as you suggested. Then I created and scheduled the task. It executed successfully, but the email was not delivered. Normally, IFS sends emails automatically for other scheduled reports, so I don’t think there’s an issue with the SMTP settings. Is there any configuration that needs to be done before the COMMAND_SYS.Mail function can be triggered?
PROCEDURE Send_Expiry_Alert_364_365 IS v_message VARCHAR2(32767); v_count NUMBER := 0; BEGIN v_message := 'The expiration date of the following products will be within 60 days:' || CHR(10);
FOR rec IN ( SELECT part_no, ifsapp.inventory_part_api.get_description(contract, part_no) AS descp, expiration_date FROM ifsapp.inventory_part_in_stock WHERE part_no IN ('SRF0-000000364', 'SRF0-000000365') AND expiration_date IS NOT NULL AND expiration_date <= TRUNC(SYSDATE) + 60 ) LOOP v_count := v_count + 1; v_message := v_message || CHR(10) || '- ' || rec.part_no || ' | ' || rec.descp || ' | Son K.T: ' || TO_CHAR(rec.expiration_date, 'DD.MM.YYYY'); END LOOP;
This is the default email format that IFS sends when everything is working correctly — including the SMTP and scheduling setup. As seen, the report is successfully attached and delivered to recipients.
@sahango Update your procedure to send an email and either you can hardcode the recipients email id or you can You can create a simple table to store recipient email addresses,
Make sure:
The COMMAND_SYS.Mail email function works in your IFS.
Email (SMTP) settings are already set up in your system.
Thank you, I added the related function as you suggested. Then I created and scheduled the task. It executed successfully, but the email was not delivered. Normally, IFS sends emails automatically for other scheduled reports, so I don’t think there’s an issue with the SMTP settings. Is there any configuration that needs to be done before the COMMAND_SYS.Mail function can be triggered?
PROCEDURE Send_Expiry_Alert_364_365 IS v_message VARCHAR2(32767); v_count NUMBER := 0; BEGIN v_message := 'The expiration date of the following products will be within 60 days:' || CHR(10);
FOR rec IN ( SELECT part_no, ifsapp.inventory_part_api.get_description(contract, part_no) AS descp, expiration_date FROM ifsapp.inventory_part_in_stock WHERE part_no IN ('SRF0-000000364', 'SRF0-000000365') AND expiration_date IS NOT NULL AND expiration_date <= TRUNC(SYSDATE) + 60 ) LOOP v_count := v_count + 1; v_message := v_message || CHR(10) || '- ' || rec.part_no || ' | ' || rec.descp || ' | Son K.T: ' || TO_CHAR(rec.expiration_date, 'DD.MM.YYYY'); END LOOP;
This is the default email format that IFS sends when everything is working correctly — including the SMTP and scheduling setup. As seen, the report is successfully attached and delivered to recipients.
@sahango Update your procedure to send an email and either you can hardcode the recipients email id or you can You can create a simple table to store recipient email addresses,
Make sure:
The COMMAND_SYS.Mail email function works in your IFS.
Email (SMTP) settings are already set up in your system.
Thank you, I added the related function as you suggested. Then I created and scheduled the task. It executed successfully, but the email was not delivered. Normally, IFS sends emails automatically for other scheduled reports, so I don’t think there’s an issue with the SMTP settings. Is there any configuration that needs to be done before the COMMAND_SYS.Mail function can be triggered?
@sahango
1. Check Background Job Log in IFS
Go to Background Jobs screen in IFS.
See if the job shows “Ready”
Look at the Message or Output field to check for any hidden warnings or silent errors — especially related to COMMAND_SYS.Mail
2. Validate Email Address Format
Make sure the email addresses used (especially the "To" address) are:
Properly written (no typos or hidden characters)
Allowed by your company’s SMTP policy (some SMTPs block personal domains like gmail.com)
Try sending to an internal address that has successfully received emails from IFS before.
3. Check the Application Messages Screen
Open the Application Messages screen (e.g., via navigator or quick search).
When COMMAND_SYS.Mail is triggered, it may log a message here — this can help you understand what happened.
You might find error details or clues (e.g., delivery failed, invalid address, blocked by SMTP, etc.).
Thanks, Hardik
When I check the Background Log, it shows that it has run successfully.
After 11:08, meaning after my task was executed, there is only one Application Message record. Error message is: ifs.fnd.base.ApplicationException: Default Mail Address specified is not valid. Where exactly are the mail settings configured in IFS? System Parameters?
As discussed on private, you found the app message :- ifs.fnd.base.ApplicationException: Default Mail Address specified is not valid