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

Question

Question

Search date field by "Today" or "Now" for use in shortcuts

asked on November 10, 2016

Is it possible to search a date field based on the Today or Now parameters?  In the client, there is the capability of searching created and modified dates using these parameters (Laserfiche actually just populates the date of today in the advanced search criteria instead of Today).  In Workflow you can use a date token calculator.  What I'm looking to do is create a desktop shortcut that searches a folder for entries with a date field populated with the current date or a date prior to the current date (<=Today).  

Thanks guys!

0 0

Replies

replied on November 10, 2016 Show version history

This is not possible directly through a desktop shortcut, but there are some other options:

- Use a .bat file that fills in the search syntax with the date:

@echo off
set X=
for /f "skip=1 delims=" %%x in ('wmic os get localdatetime') do if not defined X set X=%%x

set DATE.YEAR=%X:~0,4%
set DATE.MONTH=%X:~4,2%
set DATE.DAY=%X:~6,2%

start /b "" "C:\Program Files (x86)\Laserfiche\Client\LF.exe" -LREPOSITORYNAME -S"{[General]:[Date]<=\"%DATE.MONTH%/%DATE.DAY%/%DATE.YEAR%\"}"

Replace REPOSITORYNAME with the name of your repository and General / Date with the template and field to search on. Date calculation in batch files is hard to get right, I found this date calculation method here.

If you need more complex date calculations such as within the past two weeks, you can use powershell or vbscript to do the date calculation and launch the client with the -S parameter. For more information on the command line interface, see the online help.

- Use a saved search. Obviously not as user friendly but it is less error prone.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.