Framework EDI Reference. Methods and Properties
ediDocument. ImportSchema

Imports a schema file or Standard Reference Library version.

Syntax:

 Parameters:

 Returns:

If successful the object of type FREDI.ediSchema is returned; otherwise an empty object is returned if the operation fails.

Remarks:

Muliple schemas can be imported and made available as implementation guidelines to a document, so this method can be called multiple times for each schema to use.

ImportSchema method immediately imports the schema at the time that it is invoked unlike the LoadSchema method, which imports the schema at the time when the EDI document is about to be processed.

 Example1.  To import a Standard Exchange Format (SEF) file.

Dim oEdiDoc As Fredi.ediDocument
Dim oSchema As Fredi.ediSchema
:
Set oEdiDoc = New ediDocument
Set oSchema = oEdiDoc.ImportSchema(“C:\FILES\850.SEF”, Schema_Standard_Exchange_Format)

Example 2.  To import a version from the Standard Reference Library.   In this example, the version is ASC/X12 version 4030.

Dim oEdiDoc As Fredi.ediDocument
Dim oSchema As Fredi.ediSchema
:
Set oEdiDoc = New ediDocument
Set oSchema = oEdiDoc.ImportSchema(“X|004030”, Schema_Standard_Reference_Library)

 Example 3. To import multiple schemas.

Dim oEdiDoc As Fredi.ediDocument
Dim oSchema As Fredi.ediSchema
:
Set oEdiDoc = New Fredi.ediDocument
Set oSchemas = oEdiDoc.GetSchemas
oSchemas.EnableStandardReference = False
:
Set oSchema = oEdiDoc.ImportSchema("850_4010.SEF", Schema_Standard_Exchange_Format)
Set oSchema = oEdiDoc.ImportSchema("997_4010.SEF", Schema_Standard_Exchange_Format)

oEdiDoc.LoadEdi sPath & sEdiFile