This content has been marked as final. Show 9 replies
can you post your logic?
The default value for workflow update event is 1 hour. You can achieve the end goal without changing the config entry WorkflowIntervalHours.
after your 2 week logic
in Update script
1) Check if a worflow variable "variableX" exists and variableX is current date. If it is current date, you have sent an Email already. (step 3)
2) If theVariableX doesn't exist, indicates... it entered the update script (after your 2 weeklogic) for the first time. So, send EMail and set current Date.
3) If variable X exist and is not Current Date, indicates... mail needs to be sent today. So, send EMail and set current Date.
Edited by: Bunty on Jan 29, 2013 2:22 PM
<$if formatDateWithPattern(wfCurrentGet("lastEntryTs"), "dd") < formatDateWithPattern(dateCurrent(-3), "dd")$>
<$wfMailSubject="Hey your time is up time to review the workflow item."$>
<$wfMessage="Your over your limit"$>
Now it does send a email when the item is in that step after X days, but it does it every hour...trying to get it to send a email once a day. Figured if I mess with the number in the WorkflowIntervalHours it would affect that, but I still get one ever hour.
WorkflowIntervalHours is a config entry. You can not set it in idoc script, it won't take efffect. :)1 person found this helpful
I haven't tried it out...hope it works!
<$if wfCurrentGet("lastEntryTs") < dateCurrent(-3)$> [[%this way...month changes will also be considered%]] <$if wfGet("myLastEmailDate")$> <$if strEquals(wfCurrentGet("myLastEmailDate"),formatDateWithPattern(dateCurrent(), "ddmmyy") ) $> [[%Email is already sent%]] <$else$> <$include your_send_email_logic$> <$wfSet("myLastEmailDate", formatDateWithPattern(dateCurrent(), "ddmmyy"))$> <$endif$> <$else$> <$include your_send_email_logic$> <$wfSet("myLastEmailDate", formatDateWithPattern(dateCurrent(), "ddmmyy"))$> <$endif$> <$endif$>
Edited by: Bunty on Jan 29, 2013 2:50 PM
Huh, kinda odd it's in idoc documentation...
Sweet I will study and check it out, thank you.
I am not sure ifdate comparision (on first line of code) works, try out something...anyways
WorkflowIntervalHours is in IDoc Script Reference but, Type and Usage --> Configuration variables. Configuration variables are loaded on server start.
WorkflowIntervalHours won't help anyway - it determines only how often the code in the update event is (auto)executed.
If you have more approvers in one step, update will be executed also whenever one of approvers approves the doc.
use parseDate(wfCurrentGet("lastEntryTs")) and it should work!