Framework EDI Reference. Methods and Properties
ediSchema. TriggerLoopChange

Reference a loop definition in the ASC/X12 Transaction Set or UN/EDIFACT Message table based on the value of a data element.

Syntax:

Parameters:

Returns:

Returns 1 if successful; otherwise 0 if unsuccessful.

Remarks:

The trigger loop definitions can be included in the SEF file under the .PRIVATE EDIdEv section so that the definitions do not have to be written into your program.  The syntax of the definitions in the SEF file have the same order of parameters as of the TriggerLoopChange method, but are separated by the forward-slash. e.g. LOOP1 270/2/HL/3/0/20/200A

If trigger loop definitions are stated both in the SEF file and in the program, the trigger loop definitions in the program takes precedence over the definitions in the SEF file.

Example:

Set oEdiDoc = New Fredi.ediDocument
oSef.TriggerLoopChange "270", 2, "HL", 3, 0, "20", "2000A"
oSef.TriggerLoopChange "270", 2, "HL", 3, 0, "21", "2000B"
oSef.TriggerLoopChange "270", 2, "HL", 3, 0, "22", "2000C"
oSef.TriggerLoopChange "270", 2, "HL", 3, 0, "23", "2000D"
Set oAck = oEdiDoc.GetAcknowledgment
oEdiDoc.LoadEdi sEdiFile

The equivalent of the above trigger loop definition in a SEF file:

.PRIVATE EDIdEv
.LOOP1 270/2/HL/3/0/20/2000A
.LOOP2 270/2/HL/3/0/21/2000B
.LOOP3 270/2/HL/3/0/22/2000C
.LOOP4 270/2/HL/3/0/23/2000D