Framework EDI Reference. Methods and Properties
ediDataSegment. RecordAckCode

Record an error code in an acknowledgment document for the data segment.

Syntax:

Parameters:

Returns:

Returns 1 if the acknowledgment code was recorded successfully; otherwise 0 is returned.

Remarks:

This method is used when reading a document in Cursor_ForwardOnly, where the EDI document is traversed, and validated, a data segment at a time at which point this method can be called for any of the data segment.  Note that the acknowledgment code that is to be recorded must be pertinent to the data segment from where this method is called because other properties of the data segment may also be recorded in the acknowledgment document together with the acknowledgment code.

Example:

ediDocument oEdiDoc = null;
ediDataSegment oSegment = null;
ediAcknowledgment oAck = null;

oEdiDoc = new ediDocument();

oAck = oEdiDoc.GetAcknowledgment();
oAck.EnableFunctionalAcknowledgment = true;

oEdiDoc.CursorType = DocumentCursorTypeConstants.Cursor_ForwardOnly;

oEdiDoc.LoadSchema(sCodePath + "\\SampleSefX12_850.SEF", SchemaTypeIDConstants.Schema_Standard_Exchange_Format);
oEdiDoc.LoadEdi(sCodePath + "\\SampleEdiX12_850.X12");

//iterate through each segment in the the EDI file so that they can be validated
ediDataSegment.Set(ref oSegment, oEdiDoc.FirstDataSegment);
while (oSegment != null)
{
    String sSegmentID = oSegment.ID;
    if (sSegmentID == "FOB")
    {
        oSegment.RecodeAckValue("X");
    }

    ediDataSegment.Set(ref oSegment, oSegment.Next());
}