Framework EDI Reference. Methods and Properties
ediTransactionSet. GetSchema

Gets the schema that was used as a guideline to verify the syntax of the UN/EDIFACT Message or ASC/X12 Transaction Set, or to generate the Message or Transaction Set entity.

Syntax:

Returns

Returns an object of type FREDI.ediSchema.

Remarks

The schema returned would contain the implementation guideline that was used to process the UN/EDIFACT Message or ASC/X12 Transaction Set. The version information is taken from the Functional Group; if the Functional Group is not used then the version information is taken from the Interchange.  If the Interchange does not provides the information, then it uses the external schema that was last loaded, or the guideline in the last version of the Standard Reference Library.

Example

Dim oEdiDoc As ediDocument
Dim oSchema As ediSchema
Dim oSchema2 As ediSchema
Dim oInterchange As ediInterchange
Dim oGroup As ediGroup
Dim oTransactionSet As ediTransactionSet
Dim sEdiFile As String
Dim sSefFile As String

sEdiFile = App.Path & "\850.X12"
sSefFile = App.Path & "\850.SEF"

Set oEdiDoc = New ediDocument
Set oSchema = oEdiDoc.LoadSchema(sSefFile, 0)

oEdiDoc.LoadEdi sEdiFile

' Get Interchange from document
Set oInterchange = oEdiDoc.FirstInterchange

' Get Functional Group from Interchange
Set oGroup = oInterchange.FirstGroup

' Get Transaction Set from Group
Set oTransactionSet = oGroup.FirstTransactionSet

' Get schema object of Transaction
Set oSchema2 = oTransactionSet.GetSchema
Debug.Print "Schema Handle: " & oSchema2.Handle
Debug.Print "Schema Version: " & oSchema2.Version
Debug.Print "Schema Industry: " & oSchema2.Industry
Debug.Print "Schema Version: " & oSchema2.StandardVersion