Question

Sort detail on page load

Dear Community,

We would like to have a detail sorted by year and month on page load. Could you please let us know if there is any default sort on details or a client side code to achieve this?

Thanks

Shivani

Like

4 comments

You can edit the page you added the detail to, then modify the details, under the details section of the page code, to add a sort column using sortColumn, sortColumnDirection, and sortColumnIndex. 

Ryan

Ryan Farley,

Thanks much Ryan!

Ryan Farley,

We have a detail called contract value target in contacts section which needs to be sorted by month and year.

I tried the following in the contactsPageV2 schema.

    "UsrSchema31Detail759084ab": {
                "schemaName": "UsrSchema31Detail",
                "entitySchemaName": "UsrContractValueTarget",
                "filter": {
                    "detailColumn": "UsrSalesUser",
                    "masterColumn": "Id"
                },
           "sortColumn":"UsrYear",
           "sortColumnDirection":Terrasoft.OrderDirection.desc,
           "sortColumnIndex":0

It doesn't seem to work. Is there anything else I need to do?

 

Shivani Lakshman,

This is likely because you've added "desc" in lowercase and it should be uppercase (it's case-sensitive). Choices are: 

  • Terrasoft.OrderDirection.ASC (or a 1)
  • Terrasoft.OrderDirection.DESC (or a 2)
  • Terrasoft.OrderDirection.NONE (or a 0)

Ryan

Show all comments