Framework EDI Reference. Events
ediDocument. EventNotifyInfo

The event handler that gets called when supplemental information about an error is available.

Syntax:

Parameters:

Remarks

Since EventNotifyInfo only provides supplemental error information, not all the errors in the document will be captured in this event. EventNotify should instead be used to trap errors; while the EventNotifyInfo should be used to provide additional error information that cannot be passed to EventNotify. In cases where there is an error, but no additional error is required to pass to the client, the EventNotifyInfo will not even be activated.

Example:

The following is an example as how to listen to errors and supplemental errors:

' Set up FREDI to receive events in the module
Private WithEvents m_oEdiDoc As Fredi.ediDocument
          :
   ' In the main routine start an instance of FREDI
   Set m_oEdiDoc = New Fredi.ediDocument

          :

          :

' This is an event handler for EventNotify that captures all errors discovered
' by FREDI.
Private Sub m_oEdiDoc_EventNotify(ByVal Severity As Fredi.EventIDConstants, ByVal ErrorCode As Long, ByVal ErrorDescription As String)
   If Severity = Event_Warning Then
      Debug.Print "Error Code: " & CStr(ErrorCode)
      Debug.Print "Error Description: " & ErrorDescription
   End If
End Sub

' This is an event handler for EventNotifyInfo that captures all supplemental errors
' provided by FREDI.
Private Sub m_oEdiDoc_EventNotifyInfo(ByVal InfoType As Fredi.EventIDConstants, ByVal lInfo As Long, ByVal sInfo As String)
   If InfoType = Event_Info_Error_Segment_Handle Then
      ' Supplemental error has been passed. In this case, the error
      ' generated has happened in the following segment handle.
      Debug.Print "Segment Handle: " & lInfo

      ' The following error code ties this supplemental error to an
      ' error generated by EventNotify
      Debug.Print "Error Code: " & sInfo

   ElseIf InfoType = Event_Info_Error_Element_Position Then
      ' Supplemental error has been passed. In this case, the error
      ' generated has happened in the following data element in
      ' a segment having the following data segment handle.
      Debug.Print "Segment Handle: " & lInfo

      ' Data element position in error.
      Debug.Print "Element Position: " & sInfo

   ElseIf InfoType = Event_Info_Error_Composite_Position Then
      ' Supplemental error has been passed. In this case, the error
      ' generated has happened in a sub element belong to a composite
      ' of a segment having the following segment handle.
      Debug.Print "Segment Handle: " & lInfo

      ' Data element and sub element position in error.
      Debug.Print "Component Element Position: " & sInfo

   End If
End Sub