Framework EDI Reference. Methods and Properties
ediDataElement. Next

Gets the next data element in the collection.

Syntax:

Returns

Returns an object of type FREDI. ediDataElement; otherwise an empty object or NULL is returned if there is no more data element in the collection.

Remarks

The next data element has an ordinal position immediately following this data element in the same collection.  If this data element is the last data element in the collection then an empty object is returned.

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oSchemas As Fredi.ediSchemas
Dim oSchema As Fredi.ediSchema
Dim oDataElement As Fredi.ediDataElement
Dim oDataSegment As Fredi.ediDataSegment

' Create instance of Framework EDI.
Set oEdiDoc = New Fredi.ediDocument

' Disable standard reference library.
Set oSchemas = oEdiDoc.GetSchemas
oSchemas.EnableStandardReference = False

' Load the schema that the EDI file will use.
Set oSchema = oEdiDoc.LoadSchema(App.Path & "\SampleSefX12_850.SEF", Schema_Standard_Exchange_Format)

' Process the EDI file.
oEdiDoc.LoadEdi App.Path & "\SampleEdiX12_850.X12"

' Get first data segment in document.
Set oDataSegment = oEdiDoc.FirstDataSegment

' Get the data element that is the 5th position of the BEG data segment.
Set oDataElement = oDataSegment.GetDataElementByPos("\ISA\GS\ST\BEG<373>")

' Get the next data element in the collection.
Set oDataElement = oDataElement.Next

MsgBox "Next data element is " & oDataElement.ID

Sample

M_Next.zip