X12Writer Component

Properties   Methods   Events   Config Settings   Errors  

The X12Writer component generates X12 documents with a clear, straightforward API.

Syntax

TedX12Writer

Remarks

The component allows you to create an EDI document from scratch, one segment at a time. Here's how a document would normally be created:

  1. Call LoadSchema to load the necessary schemas for the transactions that will be used.
  2. Specify where to write the output document by setting the OutputFile, or check the OutputData property after writing.
  3. Create a new interchange start segment by setting the fields of the Interchange property and call the StartInterchange method. Once the interchange is complete, call EndInterchange to add the interchange footer.
  4. If you want to create a functional group, set the fields of the FunctionalGroup property and then call the StartFunctionalGroup. Once all the transactions in the group have been created, call EndFunctionalGroup to add a footer for the group.
  5. To start a transaction, call the StartTransactionSet method. Once all segments have been added, call EndTransactionSet to add a footer to the transaction.
  6. To begin a segment, call the StartSegment method and pass in the tag for the segment. Once all the elements in the segment have been added, call EndSegment to add the segment terminator.
  7. To write a basic element to the current segment, call the WriteElement method.
  8. To write a composite element, call the StartCompositeElement method, then call the WriteComponent method for each component, and finally call EndCompositeElement to end the element.

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

DelimiterComponentThe delimiter separating components.
DelimiterElementThe delimiter separating elements.
DelimiterRepetitionThe delimiter separating components.
DelimiterSegmentThe delimiter separating segments.
FileWriteModeDetermines how the output file is opened for writing.
FGroupAppReceiverCodeThe name or code of the intended receiver of the transaction set group.
FGroupAppSenderCodeCode identifying the sender of FunctionalGroup This is an alphanumeric property with a value between 2 and 15 characters long.
FGroupDateThe date that the group of transaction sets was prepared.
FGroupFunctionalIdentifierCodeA code identifying the type of transaction sets included in the functional group.
FGroupGroupControlNumAn identification number assigned by the sender to uniquely identify the group of transaction sets.
FGroupResponsibleAgencyCodeA code identifying the issuer of the standard that the transaction set conforms to.
FGroupTimeThe time that the group of transaction sets was prepared.
FGroupVersionCode indicating the version of the X12 standard used to construct the transaction set.
InterchangeAckRequestCode indicating whether an interchange acknowledgment is requested.
InterchangeAuthorizationInfoInformation used for additional identification or authorization of the interchange sender or the data in the interchange.
InterchangeAuthorizationInfoQualifierA code indicating the type of data supplied in Authorization Information property.
InterchangeDateThe date that the Interchange was prepared.
InterchangeInterchangeControlNumA control number assigned by the sender to uniquely identify the interchange.
InterchangeInterchangeControlVersionNumA code specifying the version of the X12 standard used to construct the Interchange.
InterchangeReceiverIDThe identification code of the receiver of the transaction set.
InterchangeReceiverIDQualifierA code that identifies the format of the receiver ID.
InterchangeSecurityInfoCoded security information associated with the Interchange.
InterchangeSecurityInfoQualifierA code indicating the type of data in the Security Information property.
InterchangeSenderIDThe identification code of the sender of the transaction set.
InterchangeSenderIDQualifierA code that identifies the format of the sender ID.
InterchangeTimeThe time that the Interchange sets was prepared.
InterchangeUsageIndicatorCode to indicate whether the interchange is a test or production.
OutputDataThe output data that has been written so far.
OutputFileThe name of the output file to which the EDI data will be written.
SegmentSuffixThe suffix that is appended to the end of a segment.
TransSetImpConventionReferenceReference used to identify the implementation convention.
TransSetTransactionSetControlNumThe unique transaction set control number assigned for a transaction set.
TransSetTransactionSetIDCodeThe identifier code for the transaction set.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

CloseCloses the writer.
ConfigSets or retrieves a configuration setting.
EndCompositeElementCloses the current composite element.
EndFunctionalGroupCloses the current functional group.
EndInterchangeCloses the current interchange.
EndSegmentFinish writing the current segment.
EndTransactionSetCloses the current transaction set.
ResetResets all properties to their default values.
StartCompositeElementStarts a composite element within the current segment.
StartFunctionalGroupStarts a new functional group in the EDI document.
StartInterchangeStarts a new interchange in the EDI document.
StartSegmentStarts a new segment with the specified tag.
StartTransactionSetStarts a new transaction set in the EDI document.
WriteComponentWrites a component element value to the current composite element.
WriteElementWrites an element value to the current segment.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

ErrorFires when an error occurs during message processing. Normally, the component fails with an error.
OutputFires when output data is written.

Config Settings


The following is a list of config settings for the component with short descriptions. Click on the links for further details.

DelimiterComponent Property (X12Writer Component)

The delimiter separating components.

Syntax

__property String DelimiterComponent = { read=FDelimiterComponent, write=FSetDelimiterComponent };

Default Value

":"

Remarks

The delimiter separating components.

In X12Reader, this type is used to hold the delimiters found when parsing the component, while in X12Writer the fields can be set to choose the delimiters that will be used when writing

This property is not available at design time.

Data Type

String

DelimiterElement Property (X12Writer Component)

The delimiter separating elements.

Syntax

__property String DelimiterElement = { read=FDelimiterElement, write=FSetDelimiterElement };

Default Value

"*"

Remarks

The delimiter separating elements.

In X12Reader, this type is used to hold the delimiters found when parsing the element, while in X12Writer the fields can be set to choose the delimiters that will be used when writing

This property is not available at design time.

Data Type

String

DelimiterRepetition Property (X12Writer Component)

The delimiter separating components.

Syntax

__property String DelimiterRepetition = { read=FDelimiterRepetition, write=FSetDelimiterRepetition };

Default Value

"^"

Remarks

The delimiter separating components.

In X12Reader, this type is used to hold the delimiters found when parsing the component, while in X12Writer the fields can be set to choose the delimiters that will be used when writing

This property is not available at design time.

Data Type

String

DelimiterSegment Property (X12Writer Component)

The delimiter separating segments.

Syntax

__property String DelimiterSegment = { read=FDelimiterSegment, write=FSetDelimiterSegment };

Default Value

"~"

Remarks

The delimiter separating segments.

In X12Reader, this type is used to hold the delimiters found when parsing the segment, while in X12Writer the fields can be set to choose the delimiters that will be used when writing

This property is not available at design time.

Data Type

String

FileWriteMode Property (X12Writer Component)

Determines how the output file is opened for writing.

Syntax

__property TedX12WriterFileWriteModes FileWriteMode = { read=FFileWriteMode, write=FSetFileWriteMode };
enum TedX12WriterFileWriteModes { fwmCreate=0, fwmOverwrite=1, fwmAppend=2 };

Default Value

fwmCreate

Remarks

When OutputFile is set, this property determines how the file will be opened.

fwmCreate (Default)Creates a new file. If the file already exists, the translation will fail.
fwmOverwriteOpens an existing file and overwrites its contents. If the file does not exist, a new file will be created.
fwmAppendOpens an existing file and appends data to the end of the file. If the file does not exist, a new file will be created.

This property is not available at design time.

Data Type

Integer

FGroupAppReceiverCode Property (X12Writer Component)

The name or code of the intended receiver of the transaction set group.

Syntax

__property String FGroupAppReceiverCode = { read=FFGroupAppReceiverCode, write=FSetFGroupAppReceiverCode };

Default Value

""

Remarks

The name or code of the intended receiver of the transaction set group.

This is an alphanumeric field with a value between 2 and 15 characters.

This property is not available at design time.

Data Type

String

FGroupAppSenderCode Property (X12Writer Component)

Code identifying the sender of FunctionalGroup This is an alphanumeric property with a value between 2 and 15 characters long.

Syntax

__property String FGroupAppSenderCode = { read=FFGroupAppSenderCode, write=FSetFGroupAppSenderCode };

Default Value

""

Remarks

Code identifying the sender of FunctionalGroup

This is an alphanumeric field with a value between 2 and 15 characters long.

This property is not available at design time.

Data Type

String

FGroupDate Property (X12Writer Component)

The date that the group of transaction sets was prepared.

Syntax

__property String FGroupDate = { read=FFGroupDate, write=FSetFGroupDate };

Default Value

""

Remarks

The date that the group of transaction sets was prepared.

This is a numeric field with a value in the format YYMMDD.

This property is not available at design time.

Data Type

String

FGroupFunctionalIdentifierCode Property (X12Writer Component)

A code identifying the type of transaction sets included in the functional group.

Syntax

__property String FGroupFunctionalIdentifierCode = { read=FFGroupFunctionalIdentifierCode, write=FSetFGroupFunctionalIdentifierCode };

Default Value

""

Remarks

A code identifying the type of transaction sets included in the functional group.

This is an alphanumeric field with a code value between of 2 characters.

This property is not available at design time.

Data Type

String

FGroupGroupControlNum Property (X12Writer Component)

An identification number assigned by the sender to uniquely identify the group of transaction sets.

Syntax

__property String FGroupGroupControlNum = { read=FFGroupGroupControlNum, write=FSetFGroupGroupControlNum };

Default Value

""

Remarks

An identification number assigned by the sender to uniquely identify the group of transaction sets.

This is a numeric field with a value between 1 and 9 digits.

This property is not available at design time.

Data Type

String

FGroupResponsibleAgencyCode Property (X12Writer Component)

A code identifying the issuer of the standard that the transaction set conforms to.

Syntax

__property String FGroupResponsibleAgencyCode = { read=FFGroupResponsibleAgencyCode, write=FSetFGroupResponsibleAgencyCode };

Default Value

""

Remarks

A code identifying the issuer of the standard that the transaction set conforms to.

This is an alphanumeric field with a code value of 1 to 2 characters.

This property is not available at design time.

Data Type

String

FGroupTime Property (X12Writer Component)

The time that the group of transaction sets was prepared.

Syntax

__property String FGroupTime = { read=FFGroupTime, write=FSetFGroupTime };

Default Value

""

Remarks

The time that the group of transaction sets was prepared.

This is a numeric field with a value between 4 and 8 digits in the format HHMM, HHMMSS, or HHMMSSDD. Time should be in the 24-hour format.

This property is not available at design time.

Data Type

String

FGroupVersion Property (X12Writer Component)

Code indicating the version of the X12 standard used to construct the transaction set.

Syntax

__property String FGroupVersion = { read=FFGroupVersion, write=FSetFGroupVersion };

Default Value

""

Remarks

Code indicating the version of the X12 standard used to construct the transaction set.

This is an alphanumeric field with a code value between 1 and 12 characters.

This property is not available at design time.

Data Type

String

InterchangeAckRequest Property (X12Writer Component)

Code indicating whether an interchange acknowledgment is requested.

Syntax

__property String InterchangeAckRequest = { read=FInterchangeAckRequest, write=FSetInterchangeAckRequest };

Default Value

""

Remarks

Code indicating whether an interchange acknowledgment is requested.

This is an alphanumeric field with a code value of 1 character, either "0" (no acknowledgment requested) or "1" (acknowledgment requested).

This property is not available at design time.

Data Type

String

InterchangeAuthorizationInfo Property (X12Writer Component)

Information used for additional identification or authorization of the interchange sender or the data in the interchange.

Syntax

__property String InterchangeAuthorizationInfo = { read=FInterchangeAuthorizationInfo, write=FSetInterchangeAuthorizationInfo };

Default Value

""

Remarks

Information used for additional identification or authorization of the interchange sender or the data in the interchange.

The type of information is set by the AuthorizationInfoQual field.

This property is not available at design time.

Data Type

String

InterchangeAuthorizationInfoQualifier Property (X12Writer Component)

A code indicating the type of data supplied in Authorization Information property.

Syntax

__property String InterchangeAuthorizationInfoQualifier = { read=FInterchangeAuthorizationInfoQualifier, write=FSetInterchangeAuthorizationInfoQualifier };

Default Value

""

Remarks

A code indicating the type of data supplied in Authorization Information field.

This is an alphanumeric field with a code value of 2 characters.

This property is not available at design time.

Data Type

String

InterchangeDate Property (X12Writer Component)

The date that the Interchange was prepared.

Syntax

__property String InterchangeDate = { read=FInterchangeDate, write=FSetInterchangeDate };

Default Value

""

Remarks

The date that the Interchange was prepared.

This is a numeric field with a value of 6 digits in the format YYMMDD.

This property is not available at design time.

Data Type

String

InterchangeInterchangeControlNum Property (X12Writer Component)

A control number assigned by the sender to uniquely identify the interchange.

Syntax

__property String InterchangeInterchangeControlNum = { read=FInterchangeInterchangeControlNum, write=FSetInterchangeInterchangeControlNum };

Default Value

""

Remarks

A control number assigned by the sender to uniquely identify the interchange.

This is a numeric field with a value of 9 digits.

This property is not available at design time.

Data Type

String

InterchangeInterchangeControlVersionNum Property (X12Writer Component)

A code specifying the version of the X12 standard used to construct the Interchange.

Syntax

__property String InterchangeInterchangeControlVersionNum = { read=FInterchangeInterchangeControlVersionNum, write=FSetInterchangeInterchangeControlVersionNum };

Default Value

""

Remarks

A code specifying the version of the X12 standard used to construct the Interchange.

This is an alphanumeric field with a code value 5 characters.

This property is not available at design time.

Data Type

String

InterchangeReceiverID Property (X12Writer Component)

The identification code of the receiver of the transaction set.

Syntax

__property String InterchangeReceiverID = { read=FInterchangeReceiverID, write=FSetInterchangeReceiverID };

Default Value

""

Remarks

The identification code of the receiver of the transaction set.

This is an alphanumeric field with a value of 15 characters.

This property is not available at design time.

Data Type

String

InterchangeReceiverIDQualifier Property (X12Writer Component)

A code that identifies the format of the receiver ID.

Syntax

__property String InterchangeReceiverIDQualifier = { read=FInterchangeReceiverIDQualifier, write=FSetInterchangeReceiverIDQualifier };

Default Value

""

Remarks

A code that identifies the format of the receiver ID.

This is an alphanumeric field with a code value of 2 characters.

This property is not available at design time.

Data Type

String

InterchangeSecurityInfo Property (X12Writer Component)

Coded security information associated with the Interchange.

Syntax

__property String InterchangeSecurityInfo = { read=FInterchangeSecurityInfo, write=FSetInterchangeSecurityInfo };

Default Value

""

Remarks

Coded security information associated with the Interchange.

The type of information is set by the SecurityInfoQualifier.

This is an alphanumeric field with a value between of 10 characters.

This property is not available at design time.

Data Type

String

InterchangeSecurityInfoQualifier Property (X12Writer Component)

A code indicating the type of data in the Security Information property.

Syntax

__property String InterchangeSecurityInfoQualifier = { read=FInterchangeSecurityInfoQualifier, write=FSetInterchangeSecurityInfoQualifier };

Default Value

""

Remarks

A code indicating the type of data in the Security Information field.

This is an alphanumeric field with a code value of 2 characters.

This property is not available at design time.

Data Type

String

InterchangeSenderID Property (X12Writer Component)

The identification code of the sender of the transaction set.

Syntax

__property String InterchangeSenderID = { read=FInterchangeSenderID, write=FSetInterchangeSenderID };

Default Value

""

Remarks

The identification code of the sender of the transaction set.

This is an alphanumeric field with a value of 15 characters.

This property is not available at design time.

Data Type

String

InterchangeSenderIDQualifier Property (X12Writer Component)

A code that identifies the format of the sender ID.

Syntax

__property String InterchangeSenderIDQualifier = { read=FInterchangeSenderIDQualifier, write=FSetInterchangeSenderIDQualifier };

Default Value

""

Remarks

A code that identifies the format of the sender ID.

This is an alphanumeric field with a code value of 2 characters.

This property is not available at design time.

Data Type

String

InterchangeTime Property (X12Writer Component)

The time that the Interchange sets was prepared.

Syntax

__property String InterchangeTime = { read=FInterchangeTime, write=FSetInterchangeTime };

Default Value

""

Remarks

The time that the Interchange sets was prepared.

This is a numeric field with a value in the format HHMM.

This property is not available at design time.

Data Type

String

InterchangeUsageIndicator Property (X12Writer Component)

Code to indicate whether the interchange is a test or production.

Syntax

__property String InterchangeUsageIndicator = { read=FInterchangeUsageIndicator, write=FSetInterchangeUsageIndicator };

Default Value

""

Remarks

Code to indicate whether the interchange is a test or production.

This is an alphanumeric field with a code value of 1 character.

This property is not available at design time.

Data Type

String

OutputData Property (X12Writer Component)

The output data that has been written so far.

Syntax

__property String OutputData = { read=FOutputData, write=FSetOutputData };

Default Value

""

Remarks

OutputData contains the entire EDI document that has been written so far. If writing to a file or stream, this property will be empty.

This property is not available at design time.

Data Type

String

OutputFile Property (X12Writer Component)

The name of the output file to which the EDI data will be written.

Syntax

__property String OutputFile = { read=FOutputFile, write=FSetOutputFile };

Default Value

""

Remarks

FileWriteMode property determines how the file is opened for writing. If OutputFile is empty, no file will be written and the OutputData property will contain the EDI data instead.

This property is not available at design time.

Data Type

String

SegmentSuffix Property (X12Writer Component)

The suffix that is appended to the end of a segment.

Syntax

__property TedX12WriterSegmentSuffixes SegmentSuffix = { read=FSegmentSuffix, write=FSetSegmentSuffix };
enum TedX12WriterSegmentSuffixes { ssNone=0, ssCR=1, ssLF=2, ssCRLF=3 };

Default Value

ssNone

Remarks

Possible values are:

ssNone (0)No suffix is appended to the segment.
ssCR (1)A carriage return (ASCII 13) is appended to the segment.
ssLF (2)A line feed (ASCII 10) is appended to the segment.
ssCRLF (3)A carriage return followed by a line feed (ASCII 13 and 10) is appended to the segment. This is the default value.

This property is not available at design time.

Data Type

Integer

TransSetImpConventionReference Property (X12Writer Component)

Reference used to identify the implementation convention.

Syntax

__property String TransSetImpConventionReference = { read=FTransSetImpConventionReference, write=FSetTransSetImpConventionReference };

Default Value

""

Remarks

Reference used to identify the implementation convention.

This is an alphanumeric field with a value up to 35 characters long.

This property is not available at design time.

Data Type

String

TransSetTransactionSetControlNum Property (X12Writer Component)

The unique transaction set control number assigned for a transaction set.

Syntax

__property String TransSetTransactionSetControlNum = { read=FTransSetTransactionSetControlNum, write=FSetTransSetTransactionSetControlNum };

Default Value

""

Remarks

The unique transaction set control number assigned for a transaction set.

This is an alphanumeric field with a value between 4 and 9 characters long.

This property is not available at design time.

Data Type

String

TransSetTransactionSetIDCode Property (X12Writer Component)

The identifier code for the transaction set.

Syntax

__property String TransSetTransactionSetIDCode = { read=FTransSetTransactionSetIDCode, write=FSetTransSetTransactionSetIDCode };

Default Value

""

Remarks

The identifier code for the transaction set.

This is an alphanumeric field with a code value of 3 characters long.

This property is not available at design time.

Data Type

String

Close Method (X12Writer Component)

Closes the writer.

Syntax

void __fastcall Close();

Remarks

Calling Close will close the writer and release any resources associated with it. After calling Close, the writer cannot be used unless it is re-initialized.

Config Method (X12Writer Component)

Sets or retrieves a configuration setting.

Syntax

String __fastcall Config(String ConfigurationString);

Remarks

Config is a generic method available in every component. It is used to set and retrieve configuration settings for the component.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

EndCompositeElement Method (X12Writer Component)

Closes the current composite element.

Syntax

void __fastcall EndCompositeElement();

Remarks

Calling EndCompositeElement will close the current composite element. If no composite element is open, an error will be raised.

EndFunctionalGroup Method (X12Writer Component)

Closes the current functional group.

Syntax

void __fastcall EndFunctionalGroup();

Remarks

Calling EndFunctionalGroup will close the current functional group. If no functional group is open, an error will be raised. This method will also write the required FunctionalGroup Trailer (GE) segment to the output.

EndInterchange Method (X12Writer Component)

Closes the current interchange.

Syntax

void __fastcall EndInterchange();

Remarks

Calling EndInterchange will close the current interchange. If no interchange is open, an error will be raised. This method will also write the required Interchange Trailer (IEA) segment to the output.

EndSegment Method (X12Writer Component)

Finish writing the current segment.

Syntax

void __fastcall EndSegment();

Remarks

Calling EndSegment will finish writing the current segment. If no segment is open or if a composite element is still open an error will be raised. This method will also write the segment delimiter and segment suffix to the output.

EndTransactionSet Method (X12Writer Component)

Closes the current transaction set.

Syntax

void __fastcall EndTransactionSet();

Remarks

Calling this method will close the current transaction set. If no transaction set is open, an error will be raised. This method will also write the required Transaction Set Trailer (SE) segment to the output.

Reset Method (X12Writer Component)

Resets all properties to their default values.

Syntax

void __fastcall Reset();

Remarks

This method resets all properties of the component to their default values as specified in the property definitions.

StartCompositeElement Method (X12Writer Component)

Starts a composite element within the current segment.

Syntax

void __fastcall StartCompositeElement();

Remarks

This method starts a composite element within the current segment. The composite element can contain multiple component elements. The composite element is ended by calling the EndCompositeElement method. Component elements within the composite are added by calling the WriteComponent method.

StartFunctionalGroup Method (X12Writer Component)

Starts a new functional group in the EDI document.

Syntax

void __fastcall StartFunctionalGroup();

Remarks

This method starts a new functional group in the EDI document. The functional group fields must be set using the appropriate properties before calling this method. The functional group is ended by calling the EndFunctionalGroup method. The functional group header segment (GS) is written to the output when this method is called.

StartInterchange Method (X12Writer Component)

Starts a new interchange in the EDI document.

Syntax

void __fastcall StartInterchange();

Remarks

This method starts a new interchange in the EDI document. The interchange fields must be set using the appropriate properties before calling this method. The interchange is ended by calling the EndInterchange method. The interchange header segment (ISA) is written to the output when this method is called. If opening a new interchange would result in an invalid structure (for example, starting a new interchange before ending the previous one), an error will be raised.

StartSegment Method (X12Writer Component)

Starts a new segment with the specified tag.

Syntax

void __fastcall StartSegment(String tag);

Remarks

This method starts a new segment with the specified tag. The segment is ended by calling the EndSegment method. Element values within the segment are added by calling the WriteElement method. Composite elements can be added to the segment by calling the StartCompositeElement method. If starting a new segment would result in an invalid structure (for example, starting a new segment before ending the previous one), an error will be raised.

StartTransactionSet Method (X12Writer Component)

Starts a new transaction set in the EDI document.

Syntax

void __fastcall StartTransactionSet();

Remarks

This method starts a new transaction set in the EDI document. The transaction set fields must be set using the appropriate properties before calling this method. The transaction set is ended by calling the EndTransactionSet method. The transaction set header segment (ST) is written to the output when this method is called. If opening a new transaction set would result in an invalid structure (for example, starting a new transaction set before ending the previous one), an error will be raised.

WriteComponent Method (X12Writer Component)

Writes a component element value to the current composite element.

Syntax

void __fastcall WriteComponent(String val);

Remarks

This method writes a component element value to the current composite element. The composite element must be started by calling the StartCompositeElement method before calling this method. The composite element is ended by calling the EndCompositeElement method. If this method is called when not within a composite element, an error will be raised.

WriteElement Method (X12Writer Component)

Writes an element value to the current segment.

Syntax

void __fastcall WriteElement(String val);

Remarks

This method writes an element value to the current segment. The segment must be started by calling the StartSegment method before calling this method. The segment is ended by calling the EndSegment method. If this method is called when not within a segment, an error will be raised.

Error Event (X12Writer Component)

Fires when an error occurs during message processing. Normally, the component fails with an error.

Syntax

typedef struct {
  int ErrorCode;
  String Description;
} TedX12WriterErrorEventParams;
typedef void __fastcall (__closure *TedX12WriterErrorEvent)(System::TObject* Sender, TedX12WriterErrorEventParams *e);
__property TedX12WriterErrorEvent OnError = { read=FOnError, write=FOnError };

Remarks

The Error event is fired in case of exceptional conditions during message processing. Normally, the component raises an exception.

ConnectionId is the associated client Id, ErrorCode contains an error code, and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.

Output Event (X12Writer Component)

Fires when output data is written.

Syntax

typedef struct {
  String Data;
  DynamicArray<Byte> DataB;
} TedX12WriterOutputEventParams;
typedef void __fastcall (__closure *TedX12WriterOutputEvent)(System::TObject* Sender, TedX12WriterOutputEventParams *e);
__property TedX12WriterOutputEvent OnOutput = { read=FOnOutput, write=FOnOutput };

Remarks

This event is fired when output data is written. The Data parameter contains the segment that was written.

Config Settings (X12Writer Component)

The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

Trappable Errors (X12Writer Component)

X12Writer Errors

202   Invalid argument.
304   Cannot write to file.
1099   Encountered an unexpected segment tag.
1100   Attempted to perform an action while the component was busy, or close an incomplete interchange.
1205   Tried to perform an operation in a bad state (such as ending an interchange before starting one).
1206   Tried to end an interchange with no contents.