{{Quickfixn}} How to prevent rejection of message missing an *optional* field.
Manuel Lopez
lopez.post at gmail.com
Mon Jan 13 16:21:28 PST 2014
Grant,
Thanks, you are right, I figured it out soon after. It's the error message
that is a little confusing there--I can see the logic of it but it's only
that a non-existent tag has been accessed, not that the data dictionary or
the spec (or any one) requires it to be in the message.
Manuel
> DO NOT set UseDataDictionary to "N" !!! It won't fix your problem, and
> it'll break any repeating groups also.
>
> The engine is operating correctly. The problem is your code. I'm guessing
> you're calling "message.LastPx" (or "GetField(31)" or whatever) without
> actually checking that LastPx is in the message.
>
> If you attempt to extract a field and it's not set, the engine assumes
> that, since you expected the field to be there, it was conditionally
> required. (Not *always* required, but conditionally required, which means
> it's only required in certain circumstances that the engine can't know.)
>
> That is today, the engine is trusting that *your* code is correct, and that
> the other party has violated *your* requirement.
>
> It appears that you want 31 to be completely optional. In that case, you
> must check to see if it's present before you extract it, e.g.
>
> if(message.IsSetLastPx)
> lastPx = message.LastPx.Value; // or whatever
>
> (Pardon me if I didn't get the function names exactly right.)
>
>
>
> On Fri, Jan 10, 2014 at 6:21 PM, Manuel Lopez <lopez.post at gmail.com>
> wrote:
>
> > I think I'll set UseDataDictionary to "N."
> >
> >
> > _______________________________________________
> > Quickfixn mailing list
> > Quickfixn at lists.quickfixn.com
> > http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com
> >
> >
>
>
> --
> Grant Birchmeier
> *Connamara Systems, LLC*
> *Made-To-Measure Trading Solutions.*
> Exactly what you need. No more. No less.
> http://connamara.com
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20140111/45c695ab/attachment.html
> >
>
> ------------------------------
>
> _______________________________________________
> Quickfixn mailing list
> Quickfixn at lists.quickfixn.com
> http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com
>
>
> End of Quickfixn Digest, Vol 27, Issue 15
> *****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20140113/9bc9bcce/attachment-0002.htm>
More information about the Quickfixn
mailing list