Framework EDI Reference. Methods and Properties
ediDataElement. DataElements

Returns the object containing the collection of component or sub elements.

Syntax:

Returns

Returns an object of type FREDI.ediDataElements.

Remarks

If an element is a composite element then it contains a collection of component elements or sub elements.  To determine if component elements exist, query the Count property, which indicates the number of component elements in the collection.

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oSchemas As Fredi.ediSchemas
Dim oSchema As Fredi.ediSchema
Dim oComposite As Fredi.ediDataElement
Dim oAllElements As Fredi.ediDataElements
Dim oDataSegment As Fredi.ediDataSegment
Dim sElements As String
Dim i As Integer

' 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 composite element.
Set oComposite = oDataSegment.GetDataElementByPos("\ISA\GS\ST\PO1\SLN\SLN<C001>")

' Get the object containing the collection of sub elements.
Set oAllElements = oComposite.DataElements

For i = 1 To oAllElements.Count

Dim oSubElement As Fredi.ediDataElement

Set oSubElement = oAllElements.DataElement(i)

sElements = sElements & oSubElement.Position & vbTab & oSubElement.ID & vbTab & oSubElement.Description & vbCrLf
Next

MsgBox "List of elements: " & vbCrLf & vbCrLf & sElements

Sample

P_DataElements.zip