Page 1 of 1

Element with skip rule ?

Posted: Tue Jun 02, 2009 7:32 am
by rawaf
Hi Every one,

Please I need your help.

I want to create new element but this element process one time every tow month (month YES another No),
So how can I created ? I try to create with skip rule to check if the element processed last month then skip, But I didn't found any database item to check.

Can you help me ?

Posted: Tue Jun 02, 2009 8:33 am
by eng_ahmad_2007
Dear Rawaf,

Follow the following steps:
1) Create a skip rule formula
2) Associate the skip rule to the Element Definition
Notice that there is no flag for processing every two months. but you can make use of the following code, you need two database items (PAY_PROC_PERIOD_END_DATE and EMP_HIRE_DATE).

processed = mod(trunc(months_between(PAY_PROC_PERIOD_END_DATE, EMP_HIRE_DATE)), 2)
if processed = 0 then
SKIP_FLAG = 'Y'
ELSE IF processed = 1 then
SKIP_FLAG = 'N'

--> This will make the element processed in one month and skipped in another starting from employee Hire Date

Regards,

Posted: Tue Jun 02, 2009 10:26 am
by rawaf
<b>Thank you Eng_ahmad_2007 [:)]</b>

Problem solved. and I will write The formula of skip role if any one need it:
==========================================
==========================================
/* Defaults Section */

default for SKIP_FLAG IS 'N'
Default For PAY_PROC_PERIOD_END_DATE is '4712/12/31 00:00:00'(date)
Default For EMP_HIRE_DATE is '0001/01/01 00:00:00'(date)

/* Formula Body */


processed = mod(trunc(months_between(PAY_PROC_PERIOD_END_DATE, EMP_HIRE_DATE)), 2)
if processed = 1 then
SKIP_FLAG = 'Y'

ELSE IF processed = 0 then
SKIP_FLAG = 'N'

RETURN SKIP_FLAG

==========================================
==========================================

Posted: Tue Jun 02, 2009 11:09 am
by eng_ahmad_2007
You are most welcome Rawaf [:)]
I am happy that I helped. Let us make this forum the best for sharing HR Knowledge and experience.