Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom 713 posts 954 karma points
    Oct 16, 2014 @ 01:22
    Tom
    0

    Sequence Contains no Elements

    Hi I'm using a DynamicRecord for contour and doing

    if(entry.HasField("First Name")) {
    entry.GetField("First Name");
    }

    My form doesn't have a First Name field at the moment so when I go to GetField it returns a Sequence contains no elements exception.

     

    Just wondering if this is a known bug and the best practice way of getting form field responses without wrapping everything in try catches?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Oct 16, 2014 @ 19:17
    Jan Skovgaard
    0

    Hi Tom

    What version of Contour and Umbraco are you using?

    Not sure if it helps in your case but perhaps try running the script as Mike suggests here: http://our.umbraco.org/forum/umbraco-7/using-umbraco-7/53211-Sequence-contains-not-matching-element#comment185357

    Cheers, Jan

Please Sign in or register to post replies

Write your reply to:

Draft