Skip to Content
1
Jul 06, 2020 at 12:41 PM

ABLS - How to Get related documents in Document Flow?

81 Views Last edit Jul 22, 2020 at 05:05 PM 4 rev

Hi!

I am having some issues on getting related documents in Document Flow in OnSave Events.

For instance, on saving a Customer Invoicing, I need to retrieve documents in Document Flow (Sales Order, Customer Invoice Request, etc).

Is there any way to do that? Is there any field that relate these documents?

I have tried with the following code placed in the OnSave event, but the result, is always empty

var refDocument = this.GetFirst().ID.RemoveLeadingZeros(); 
var key : BusinessDocumentFlowKey;
key.AnchorObjectNodeReference.FormattedID = refDocument;
key.AnchorObjectNodeReference.ObjectTypeCode = "28";
var flow = BusinessDocumentFlow.Retrieve(key);

Thanks in Advance.