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 952 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 11258 posts 23500 karma points MVP 7x 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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies