locked
Customer Portal CRM 2011 on premise - cannot sort cases by descending date RRS feed

  • Question

  • Hi,

    I can't sort the cases by descending dates ... I have modified the view "Cases Web View" to sort by dates et customer... but it changes nothing in Customer portal !

    Thanks for the help

    Friday, June 15, 2012 3:53 PM

Answers

  • I've recently had the same problem.  It doesn't appear to pull sorting options in the code, only the columns.

    However, I did find a work around.  Using Visual Studio, I modified CaseAccess.cs and added a orderby into GetCasesByCustomer section.

                    orderby c.GetAttributeValue<Guid?>("createdon") descending

    • Marked as answer by Stephane_CRM Friday, August 3, 2012 7:17 AM
    Thursday, August 2, 2012 6:32 PM
  • Thanks for the answer...

    What I did to sort cases, is to modify the request to display the cases via Visual Studio in ViewCases.aspx.cs : 

    var casesByStatus = string.Equals(status, "En cours", StringComparison.InvariantCulture)
                    ? cases.Where(c => c.StateCode == (int)Enums.IncidentState.Active).OrderByDescending(c => c.CreatedOn)
                    : cases.Where(c => c.StateCode != (int)Enums.IncidentState.Active).OrderByDescending(c => c.CreatedOn);

     
    Friday, August 3, 2012 7:17 AM

All replies

  • I've recently had the same problem.  It doesn't appear to pull sorting options in the code, only the columns.

    However, I did find a work around.  Using Visual Studio, I modified CaseAccess.cs and added a orderby into GetCasesByCustomer section.

                    orderby c.GetAttributeValue<Guid?>("createdon") descending

    • Marked as answer by Stephane_CRM Friday, August 3, 2012 7:17 AM
    Thursday, August 2, 2012 6:32 PM
  • Thanks for the answer...

    What I did to sort cases, is to modify the request to display the cases via Visual Studio in ViewCases.aspx.cs : 

    var casesByStatus = string.Equals(status, "En cours", StringComparison.InvariantCulture)
                    ? cases.Where(c => c.StateCode == (int)Enums.IncidentState.Active).OrderByDescending(c => c.CreatedOn)
                    : cases.Where(c => c.StateCode != (int)Enums.IncidentState.Active).OrderByDescending(c => c.CreatedOn);

     
    Friday, August 3, 2012 7:17 AM