Copied to clipboard

Flag this post as spam?

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


  • Scott 95 posts 277 karma points
    Mar 27, 2015 @ 12:40
    Scott
    0

    How to loop through records and sort them

    Hi,

    I have the following script, but I would like to sort the records by field1, does anyone know how to do this?

    RecordStorage storage = new RecordStorage();
    Record rec = storage.GetRecord(new Guid(record.Id));
    RecordService service = new RecordService(rec);
    
    try {
         RecordField field1 = rec.GetRecordField("field1");
         RecordField field2 = rec.GetRecordField("field2");
         if(field1 != null)
         {
             <option value="@record.Id" @(record.Id == @ruid ? " selected" : "")>@field1.ValuesAsString() - @field2.ValuesAsString()</option>
         }
    }
    catch { }
    

    Kind regards

  • Chris Wilson 100 posts 377 karma points
    Mar 27, 2015 @ 16:53
    Chris Wilson
    0

    I'm confused by two things:

    1. What RecordService instance are you using that takes a Record as a constructor overload?

    2. The example code you have shown is focussed around getting a single record - what records are you seeking to sort?

    Regards, Chris

Please Sign in or register to post replies

Write your reply to:

Draft