Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...love the site and am constantly recommending it to (selected !) clients here in ireland..."

Geography

Where in the world do Tek-Tips members come from?

workflow expression builder - compare two dates

AlphaLobster (Programmer)
10 Apr 12 5:55
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
appnair (Programmer)
10 Apr 12 12:22
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
http://www.tek-tips.com/faqs.cfm?fid=2884
http://www.linkedin.com/in/appunair

AlphaLobster (Programmer)
11 Apr 12 5:40
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..
appnair (Programmer)
11 Apr 12 9:52
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
http://www.tek-tips.com/faqs.cfm?fid=2884
http://www.linkedin.com/in/appunair

appnair (Programmer)
11 Apr 12 14:04
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
http://www.tek-tips.com/faqs.cfm?fid=2884
http://www.linkedin.com/in/appunair

AlphaLobster (Programmer)
18 Apr 12 9:44
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?
 
ggriffit (Programmer)
19 Apr 12 14:20
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
http://www.greggriffiths.org/livelink/

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close