X12 Acknowledgement creation - null error encountered (elementNote.ContextErrors)

Dec 27, 2012 at 2:16 AM

File Name: X12Extensions.cs

elementNote.ContextErrors is null (when I was using one of the 837 files). For now, I am checking for null condition before the foreach loop.

 foreach (var context in elementNote.ContextErrors)
      var ctx = ik4.AddSegment<TypedSegmentCTX>(new TypedSegmentCTX());
      ctx.CTX01._1_ContextName = "SITUATIONAL TRIGGER";
      ctx.CTX01._2_ContextReference = context.IdentificationReference;
      ctx.CTX02_SegmentIdCode = context.SegmentIdCode;
      ctx.CTX03_SegmentPositionInTransactionSet = context.SegmentPositionInTransactionSet;
      ctx.CTX04_LoopIdentifierCode = context.LoopIdentifierCode;

Please look into this