Framework EDI Reference. Methods and Properties
ediSchemas. DefineSegmentID

Re-identifies the data segment by specifying a new identifier code for the data segment.

Syntax:

 Parameters:

Remarks

The data segment identifier code indicates the type of data segment that is encountered in the document. Some data segment types control how the document is processed like indicating the beginning and end of a semantic level.

The following Visual Basic code re-identifies the Interchange Control Header ISA (X12) from the default ID of "ISA" to "ISA2".

For the settings to take effect, this method must be called before the schema is imported; that is, it should be called before the Import or LoadEdi/LoadEdiString methods are executed in the program.

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oSchemas As Fredi.ediSchemas
Dim oSef As Fredi.ediSchema
Dim sSefFile As String
Dim sEdiFile As String

sSefFile = App.Path & "\850.sef"
sEdiFile = App.Path & "\850.x12"

Set oEdiDoc = New Fredi.ediDocument
Set oSchemas = oEdiDoc.GetSchemas
oSchemas.DefineSegmentID(DataSegment_X12_Interchange_Control_Header) = "ISA2"

Set oSef = oEdiDoc.LoadSchema(sSefFile, 0)

oEdiDoc.LoadEdi sEdiFile

MsgBox "Done"