Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

date comparison in workflow

NM
Valued Contributor II
Valued Contributor II

Hi,

We have a use case where we have to send entitlement for approval based on difference between the end and start date.

if enddate-startdate is greater then 2 months send to user group for approval otherwise to manager for approval.

I tried with request_access.startdate - request_access.enddate but that doesn't seem to work (No request is getting submitted)

Can someone please provide a sample to use enddate and startdate in workflow?

Thanks

7 REPLIES 7

rushikeshvartak
All-Star
All-Star
com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).startdate.format("HH").toInteger()>17

Regards,
Rushikesh Vartak
If you find this response useful, kindly consider selecting 'Accept As Solution' and clicking on the 'Kudos' button.

NM
Valued Contributor II
Valued Contributor II

Hi Rushikesh,

Tried with the one provided by you in if else block it doesn't seem to work, Received below error message.

"Script evaluation error"

NM_0-1704654424776.png

Expression language selected is "Groovy"

Condition

NM_1-1704654547538.png

 

Above one was sample please change as per your requirements 


Regards,
Rushikesh Vartak
If you find this response useful, kindly consider selecting 'Accept As Solution' and clicking on the 'Kudos' button.

NM
Valued Contributor II
Valued Contributor II

I will make the changed as per the requirement but the above provided one also doesn't work. Do I need to add something else to make it work?

Thanks

com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).startdate.format('HH').toInteger()>17

Regards,
Rushikesh Vartak
If you find this response useful, kindly consider selecting 'Accept As Solution' and clicking on the 'Kudos' button.

NM
Valued Contributor II
Valued Contributor II

I have tried this but gives an error and mentioned the same in my previous comment..

com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).startdate.format('HH').toInteger().equals('17')

Regards,
Rushikesh Vartak
If you find this response useful, kindly consider selecting 'Accept As Solution' and clicking on the 'Kudos' button.