Framework EDI Reference. Methods and Properties
ediSchemas. DefineMessageID

Re-identifies the UN/EDIFACT message by specifying a new identifier code for the message.

Syntax:

Parameters:

Controlling Agency:

Remarks

The message identifier code identifies the type of message used to build a message in a document. The message must be defined in the schema with the identifier code that is to be used.

The following is a Visual Basic program that defines the acknowledgment from the default ID of "CONTRL" to "CONTRL2". It uses the Standard Exchange Format file that has the acknowledgment message defined as:

The code is:

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

sSefFile = App.Path & "\ORDERS.sef"
sEdiFile = App.Path & "\ORDERS.edi"

Set oEdiDoc = New Fredi.ediDocument

oEdiDoc.SegmentTerminator = vbCrLf
oEdiDoc.ElementTerminator = "+"
oEdiDoc.CompositeTerminator = ":"
oEdiDoc.ReleaseIndicator = "?"
oEdiDoc.DecimalNotation = "."

Set oSchemas = oEdiDoc.GetSchemas
oSchemas.EnableStandardReference = False
oSchemas.DefineTransactionSetID(Message_UN_Functional_Acknowledgment) = "CONTRL2"

Set oSef = oEdiDoc.LoadSchema(sSefFile, 0)

Set oAck = oEdiDoc.GetAcknowledgment
oAck.EnableFunctionalAcknowledgment = True

oEdiDoc.LoadEdi sEdiFile

MsgBox "Done"