Skip to main content
Solved

custom expression to use when scheduling an App Task

  • September 1, 2022
  • 4 replies
  • 384 views

Forum|alt.badge.img+4
  • Do Gooder (Customer)
  • 7 replies

Can someone provide an example of a custom expression to use when scheduling a Run Application Server Task?  I have a task that should run WEEKLY ON MON AT 17:00 but if Monday is a Holiday I want it to run on TUES.  Our holidays are defined in work_time_exception_code.

Best answer by CallumW

Give this a try: 

 ifsapp.work_time_calendar_api.Get_Next_Work_Day('*', next_day(SYSDATE, 'MONDAY' )-1)+ (1020/60/24)

Just change * to the name of the Calendar you are using linked to the exceptions.

View original
Did this topic help you find an answer to your question?

4 replies

Charith Epitawatta
Ultimate Hero (Employee)
Forum|alt.badge.img+31

Hi @anntarr,

You are supposed to use Oracle expressions that return a date/time value as the expression. SQL statements are not allowed as a custom expression. However a function call which returns a date value can be used.

Eg:

Instead of using...

select DATE_FROM 
from IFSAPP.ACCOUNTING_PERIOD t
where t.COMPANY = '10' AND t.ACCOUNTING_YEAR = '2016'
AND ACCOUNTING_PERIOD = 1;

...the function call given below can be used:

ACCOUNTING_PERIOD_API.Get_Date_From(10,2016,1);

So I think you can create a Util package in the database and write a function to return the date as you need and then use that function as the expression. 

Following post has an example expression using Oracle expressions:

Hope this helps!


Forum|alt.badge.img+16
  • Superhero (Partner)
  • 446 replies
  • September 2, 2022

Hi @Charith Epitawatta 

 

It depends if we are talking about Application Server Tasks or Database Tasks.

For the second, Oracle scheduler settings are acceptable:

https://docs.oracle.com/database/121/ARPLS/d_sched.htm

ex: FREQ=MONTHLY;BYDAY=1SUN;BYHOUR=12


CallumW
Superhero (Partner)
Forum|alt.badge.img+15
  • Superhero (Partner)
  • 128 replies
  • Answer
  • September 2, 2022

Give this a try: 

 ifsapp.work_time_calendar_api.Get_Next_Work_Day('*', next_day(SYSDATE, 'MONDAY' )-1)+ (1020/60/24)

Just change * to the name of the Calendar you are using linked to the exceptions.


Forum|alt.badge.img+4
  • Author
  • Do Gooder (Customer)
  • 7 replies
  • September 6, 2022

Thanks, that worked!


Reply


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