Warning Event

Fires whenever a validation warning is encountered.

Syntax

ANSI (Cross Platform)
virtual int FireWarning(TRADACOMSWriterWarningEventParams *e);
typedef struct {
int WarnCode;
const char *Message;
int SegmentNumber;
const char *SegmentTag;
const char *SegmentErrorCode;
const char *ElementErrorCode;
int ElementPosition; int reserved; } TRADACOMSWriterWarningEventParams; Unicode (Windows) virtual INT FireWarning(TRADACOMSWriterWarningEventParams *e);
typedef struct {
INT WarnCode;
LPCWSTR Message;
INT SegmentNumber;
LPCWSTR SegmentTag;
LPCWSTR SegmentErrorCode;
LPCWSTR ElementErrorCode;
INT ElementPosition; INT reserved; } TRADACOMSWriterWarningEventParams;
- (void)onWarning:(int)warnCode :(NSString*)message :(int)segmentNumber :(NSString*)segmentTag :(NSString*)segmentErrorCode :(NSString*)elementErrorCode :(int)elementPosition;
#define EID_TRADACOMSWRITER_WARNING 3

virtual INT IPWORKSEDI_CALL FireWarning(INT &iWarnCode, LPSTR &lpszMessage, INT &iSegmentNumber, LPSTR &lpszSegmentTag, LPSTR &lpszSegmentErrorCode, LPSTR &lpszElementErrorCode, INT &iElementPosition);

Remarks

The Warning event will fire if a validation error is encountered when writing a new segment to the output document. The WarnCode parameter contains the type of warning encountered. Message is a textual description of the problem. SegmentNumber is the index of the segment where the problem was found.

0 The component is not required but is present.
1 Invalid segment count.
2 Invalid transaction count.
3 Invalid group count.
4 Invalid interchange control number.
5 Invalid group control number.
6 Invalid transaction control number.
10 A required data element is missing.
11 Invalid field length.
12 Invalid field value.
13 A required component is missing.
14 The data element is not defined but is present.
30 Required segment is missing.
31 Required loop is missing.
32 Occurrences exceeds the schema defined limit.
33 Occurrences is less than the schema defined minimum.
40 Paired rule validation failed, the pair of elements must be present.
41 At least one of element is required, see message for list of elements.
42 Exclusion validation failed, only one of the elements can be present.
43 Conditional rule validation failed.
44 List conditional rule validation failed.
45 First then none validation failed. The presence of an element requires that other specific elements must not be present.
46 Only one or none of the elements can be present.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 C++ Edition - Version 20.0 [Build 8203]