Link Relevant Entries Template

This workflow retrieves a field value from a newly created document, searches the repository for another document with the same field value, and creates a document relationship link between the two.

How it works

  1. A Retrieve Field Values activity gets the “Workflow Templates: PO Number” field value from a newly created entry (e.g., a new invoice).
  2. The Search Query activity uses the retrieved value to search for another entry that has the same value in its “Workflow Templates: PO Number” field that is not the starting entry. The Search Repository activity requires advanced search syntax.
  3. Tip: Instead of writing this syntax from scratch, use the automatically generated syntax in the Laserfiche Windows client. In the Laserfiche Windows client, open the Advanced search box and run the search you want your workflow to run. Copy the syntax from this search box in to the Search Repository activity’s Search Query property box. Swap any sample values you used in the client search with Workflow tokens to make the search dynamic. In this workflow, I also changed the Entry ID equals "=" operator to the not equal "<>" operator.

    Example: You want your workflow to link applicants’ resumes and applications, so you run a sample search in the Windows client for documents with “John Jones” in the Applicant Name field. After you copy the syntax into the Search Repository activity, delete “John Jones” and use the Token button (right arrow) to insert the Retrieve Field Values’ Applicant Name token instead.

  4. The Create Link activity links the starting entry (the created invoice) with the entry found by the search (the related PO).

To run this workflow template in the provided test environment

You can run this workflow from the Start Business Process dialog in the Laserfiche Windows or web client, or you can satisfy its condition starting rule.

To run as a business process

  1. Ensure the workflow’s starting rule is enabled in the Workflow Rule Manager.
  2. In the Laserfiche Windows or web client, select a document in the Workflow Templates - Test Entries folder that has a value in the field, “Workflow Templates: PO Number.” For example, select one of the Invoices in the \Workflow Templates - Test Entries\Sales\Invoices folder.
  3. Right-click the entry and select Start Business Process.
  4. Choose Template - Link Relevant Entries, and review the description so you understand how the workflow will run.
  5. Click Start. The workflow will run to completion without any further input.
  6. Check the Links tab of the entry’s metadata to see the link the workflow created.

To run with a starting rule

  1. Create a document in the Workflow Templates - Test Entries folder, assign it the Workflow Template template, and type a number in the “Workflow Templates: PO Number” field.
  2. Note: For the workflow to run successfully, another entry in the Workflow Templates - Test Entries folder must also have the same number in its “Workflow Templates: PO Number” field. Otherwise, the workflow will not find an entry to link the created entry.
    For example, if you create a document with “234” in the “Workflow Templates: PO Number” field, it will link to Purchase Order 234.

  3. Check the Links tab of the entry’s metadata to see the link the workflow created.

Alternatively, you can test the workflow (bypassing the starting rule) with the Run Current Workflow option in the Workflow Designer. You can run the workflow on one of the Invoices in the \Workflow Templates - Test Entries\Sales\Invoices folder.

Ideas to expand this workflow

The template is configured to link invoices and purchase orders, but it could easily be edited to link resumes and applications, meeting minutes and proposed projects, or any number of related documents.

Laserfiche comes with some default document relationships, but you can create custom relationships that reflect your needs in the Laserfiche Administration Console.

Remember to republish the workflow after making any changes.