Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

workflow expression builder - compare two dates

Status
Not open for further replies.

AlphaLobster

Programmer
Feb 21, 2005
3
GB
Hi,

workflow expression builder only seems to allow you to compare a date attribute against a date that you must specify, ie you must select the day, date and month..

Is there any way to compare a date attribute against a 'today' value, or another date attribute without coding?

I'm working on 9.7.1 with workflow painter 4.5.0.

thanks
 
i assume you don't want to use oscript.I have an idea perhaps it may suit your work.Assume you have a form step in the workflow perhaps the first step.You could use javascript in your browser to find the system date and time of the client browser,not perfect but at least your dbserver is not in a different TZ than your client..I would store this in a hidden or unhidden form field which I would call systemdate.After the form is submitted and the workflow is started I would store that in a WFATTRIBUTE called sysdate_from_form using the robot step(a.k.a process).At this point you have what you are looking for.I am sure you can map form fields to wfattribute fields and vice versa so long as they are the same data types.I am simply using that in a different way that is all.

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Thanks appnair, but i wonder if the issue would remain - that even if i did get the system date using javascript and i assign it to a workflow variable i still can't compare that date with my other wfattribute date as the interface restricts you to choosing from the day, month, year dropdown boxes..
 
Sorry I did not think about that.have you tried asking the workflow forum in KB.perhaps you can use an enhanced package like XMLWFEXTENSION and do this without oscript.You may have to re-design your logic so that the interface problem remains in the background.If I am not wrong the workflow expression builder allows you to do something with attributes would not a wf date attribute be used for this.Sorry have not looked at workflow for some time.Frankly an oscript person can do this in a matter of hours ie not change the gui but all this comparison stuff so i would cheat and go that route

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
I did look at the problem and you are correct the WF attribute expression needs to know before hand a date type to compare things
Unfortunately I see no easy way to do this you could probably ask OT for an enhancement request.



Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Here's my plan, though i don't quite know how to implement it.

I Have my WF attributes review_date which is populated, adn my_date_diff which is blank

using javascript, i say my_date_diff = review_date - today()

From there i can use the standard interface to check decide what to do depending on how close to the review_date we are..

i notice i can sneak javascript in to the instructions fields in the attribute sections.

..is this feasible?
 
yep that will work and give you the correct value, just make sure it only fires once, otherwise each time the step is opened it could fire and update the value etc.

you will also need to be sure that your users are aware of this as otherwise they will get an error when trying to send the step on if they have not saved the attributes page, even if they have not changed anything because your code has.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top