How to Configure Technical Rule with "Startdate" Condition

KK
New Contributor III
New Contributor III

Hi.
I want to assign enterprise role to user if the user's startdate is within 7 days.
How to set Technical Rule condition for this?

I tried with below condition, but both condition do not work well.

Users.startdate Less than sysdate()+7

Users.startdate Less than date(sysdate()+7)

Best Regards,

6 REPLIES 6

rushikeshvartak
All-Star
All-Star

a.statuskey = 1 and  datediff (curdate(), a.startdate) between 0 and 7

Refer : https://forums.saviynt.com/t5/lifecycle-policies-rules/implementing-birthright-rules-technical-rules...

naveenss
All-Star
All-Star

Hi @KK 

Please use the below query in the technical rules (use advanced query for this)

date(a.startdate) < curdate()+7

The above query provides all the users having startdate less than the current date + 7 days. But I would suggest you have the condition as below.

date(a.startdate) = curdate() + 7

Configure a user update rule, make this user update rule as a detective one. And re-run the technical rule on a daily basis to check the condition for users whose startdate will be in next 7 days. 

Hope this helps! Let me know in case of any clarifications.

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

pmahalle
Valued Contributor II
Valued Contributor II

Hi @KK ,

Enable advanced config in your rule and use below query:

a.statuskey=1 and datediff (curdate(), a.startdate) between 0 and 7


Regards,

Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.

KK
New Contributor III
New Contributor III

Hi @pmahalle @naveenss @rushikeshvartak 
Thanks all.
Bellow query seems to work.
a.statuskey = 1 and datediff (curdate(), a.startdate) between 0 and 7
But, there is still issue
With this query, if start date is today, the rule is run.
But, if start date is tomorrow, the rule does not run.
Tomorrow is within 7 days, so, the rule should run.

Do you have any idea?

pmahalle
Valued Contributor II
Valued Contributor II

Hi @KK ,

Ohh so you want 7 days ahead of the start date not behind. In that case use below query.

a.statuskey = 1 and datediff (curdate(), a.startdate) between -7 and 0


Regards,

Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.

KK
New Contributor III
New Contributor III

@pmahalle 
Thanks, it works.