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

    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

Please Sign in or register to post replies

Write your reply to: