PARTNERS - Please join us for our upcoming webinar:
Leveraging Intelligent Recommendations for Operational Transformation.
AMS Partners click HERE | EMEA/APJ Partners click HERE

date comparison in workflow

NM
Honored Contributor
Honored Contributor

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 this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor
Honored Contributor

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 this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor
Honored Contributor

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 this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor
Honored Contributor

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 this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.