Okay I’ve been asking a few times about using the built-in EDI batching services but it seems no one’s really used it, so with a bit of tinkering I believe I have figured it out.
First I added the ISA/GS headers to the individual ST segment (for PO). Then I send the PO to TN with ISA/GS so that it has the sender/receiver. This is split in TN into 3 separate docs, one for X12, Group and 850. I have a rule on the 850 which puts it into a public queue. The queue calls the built-in EDI batch scheduled delivery service.
For the inputs to this batch service I could only get it to work by providing the sender and receiver ID (duns with qualifier 01). Based on the docs it should get it from the ISA header but it’s not doing that at this point.
The batch is sent to TN. Then I have a second rule on the batched X12 envelope, but the key is to use Extended criteria field ‘EDI Batch’ so put ‘EDI Batch equals none’. This is how TN differentiates between the individual envelopes for each txn and the actual batch. When the X12 is sent as a batch it will have the attribute EDI Batch set to ‘Interchange’.
Hope that helps someone.