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

Question

Question

Find file with greatest entry ID but NOT the starting entry

asked on March 13, 2017

I have seen a few different posts similar to what I am looking to accomplish, but nothing is exactly what I need!  So here it goes...
I have a workflow that determines the status of a document (New, Cancelled, Revised or Reissued) where each is an update to the previous.  When a document has a status of 'REISSUED' I need the workflow to find the most recent document (highest entry ID) and append the pages to it.  I have the following workflow steps, but the problem I am running into is it finding itself as being the document with the greatest entry ID and I am not sure how to get around this - is there a NOT qualifier when searching by entry ID??  

Any help is much appreciated!

-Nate

0 0

Replies

replied on March 13, 2017 Show version history

Hi Nate,

Personally rather than looping through each entry I would modify your search at the top of the workflow. You can modify the search syntax to exclude a certain Entry ID (which in this case would be the global token "Starting Entry ID"):

{Your current search} & {LF:ID<>%(Entry ID)}

If you were in the Laserfiche Client you could then order by the Entry ID column to find the max. In workflow it's slightly different but can still be done. In the configuration of the "Search Repository" activity, set the following:

I think this is what you're trying to achieve? If not I might have misunderstood so sorry in advance!

Cheers, Dan

4 0
replied on March 13, 2017 Show version history

Nate,

How about something like this?  It uses a 'global' integer token that is set to zero to start with.  Each loop through the search results compares the global token to the CurrentEntryID.  If the CurrentEntryID is greater than the global token then update the global token with the value of the CurrentEntryID.  Importantly, at the end of the process I would check to make sure the global token is no longer a zero.  If it is then something went wrong!  ;-)

Update: You can also check the value in the global token against the starting entryID to make sure the process does not return itself...

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

Sign in to reply to this post.