Copied to clipboard

Flag this post as spam?

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


  • Preethi 32 posts 99 karma points
    Apr 18, 2016 @ 08:51
    Preethi
    0

    RecordsFromForm - Order by field values

    I am not sure how to order the entries based on record field values. This is my code

    var allEntries = Library.GetRecordsFromForm(formGUID); var entries1 = allEntries.Items.Where(i => (i.RecordFields.Values.Any(f => f.ValuesAsString().Contains(str)))).ToList();

    I am able to filter the values based on RecordFieldValues but cannot order them.

    I have tried var entries1 = allEntries.Items.Where(i => (i.RecordFields.Values.Any(f => f.ValuesAsString().Contains(str)))).OrderByDescending(g=>g.RecordFields.Values.Where(d=>d.Field.Caption=="#Test")).ToList();

    Comes up with an error Exception: System.ArgumentException: At least one object must implement IComparable

  • 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