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

Question

Question

Workflow - method to determine that two documents are already linked

asked on January 26, 2024

Hello,

I have a process in place that involves users inputting a PO number on an invoice. Whenever an invoice changes and the PO number field isn't empty, Workflow runs a search to find the PO elsewhere in the repository, and copies some multi-value field data from the PO to the invoice.

PO numbers could be added to the invoice at almost any point in this customer's invoice process, so I'd like this workflow to run any time the invoice changes and the PO Number field is not empty. However, I can't have it appending these multi-value fields over and over again from the same POs. Is there a good way to somehow "mark" a PO in a way that would allow me to tell Workflow to ignore if it's already been linked with a particular invoice? By "linked," I mean both document relationships (we're linking them together that way) or some other method, like assigning the entry ID of the invoice to a multi-value field on the PO template, and somehow recognizing if it's already there. Or something like that.

Thanks!

0 0

Replies

replied on January 26, 2024 Show version history

I may have something figured out.



Here's the section of this workflow that pertains to all this. So Workflow will iterate through each value in the PO Number multi-value field. It looks for the PO based on the PO Number, and if it finds it, it retrieves field values to use later, and then makes a decision: if the Entries Linked To field is empty (indicating this PO hasn't been connected to an invoice yet), it assigns the GL data to the invoice from the PO, and then assigns the invoice's entry ID to the Entries Linked To field on the PO. If the PO in question has already been connected to an invoice, the workflow take the branch I have highlighted. It creates a flattened token with all values from the Entries Linked To field on the PO and checks to see if this flattened token contains the entry ID of the invoice. If it does not (indicating this invoice and PO have not been connected yet), it assigns the GL data to the invoice from the PO. My last conditional sequence in that branch seems redundant now, as both of those should get evaluated the same.

Otherwise, does this seem like the best way to do this? I'd like to be able to include that Entries Linked To field in my search for POs, and somehow say "find the PO with this PO Number, but only if the Entries Linked To field is empty OR it does not contain the invoice entry ID," but I couldn't figure out how to get that to work. 

EDIT: found this solution from a post 10 years ago. Changed my workflow a little bit and this works great

replied on January 26, 2024 Show version history

@████████ 's solution from 10 years ago  worked great. Changed my workflow a little bit and it does what I need it to. Many thanks!

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

Sign in to reply to this post.