You are viewing limited content. For full access, please sign in.

Question

Question

Setting date field default to a previous date?

asked on February 8, 2016 Show version history

A workflow was created for a customer that scans handwritten timesheets into Laserfiche.

The customer then manually adds the employee code and date in the metadata, it is then filed to the correct location based on the metadata entered.

These timesheets are usually scanned in on a Monday or Tuesday each week.  The Date in the metadata is set as the previous Sunday.  E.G timesheets would be scanned on Monday 08/02/16 (australian date format) and metadata date would be Sunday 07/02/16.

Is it possible to use the %Date field or any other field and have the date automatically adjusted to the previous Sunday?

This would save a manual step in the processing of the time sheets.

 

Any thoughts or ideas would be great.. 

 

Regards

Ziad

0 0

Replies

replied on February 9, 2016

Hi Ziad,

 

I assumed you could use the date token calculator activity in workflow to do this. But it seems you can only go forward to the next day of the week...

 

What you need is the previous day of the week. You might be able to do this using a token function or using the token calculator first, but I'm not sure how.

 

For now I guess this would have to be a feature request to have previous day of the week as a selectable option in the date token calculator?

 

Tough one...frown

0 0
replied on February 24, 2017

The Date token calculator is great for this.  It gives you both add and subtract as well as change it to almost any time unit.  This one finds last week, Sunday to Saturday.  The report runs on Thursdays.

 

 

 

 

 

 

0 0
replied on February 9, 2016 Show version history

What you could do is use two Date Token Calculator tokens. For the first token, find the Date and subtract one week from it. Then using the next Date Token Calculator, find the next Sunday. That should find the "previous" Sunday. 

If timesheets ever get submitted on Sunday, you'll need to add some error handing, otherwise the "next" Sunday will be submitted. To do that, you could take the current %(Date) token and use token formatting to only capture the day of the week [ %(Date#"dddd"#) ], and then see if that day equals Sunday.

Dates.png
Dates.png (9.77 KB)
0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.