Default sorting in panes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bakvik
    Junior Member
    • Mar 2021
    • 22

    Default sorting in panes

    Good day all. Does anyone know how to the change the default sort order of (specifically) the entries in the Document pane of the Account scope in the Detail view? By default it's ordered by "createdAt", i would like to change it to another field.

    Adding a
    PHP Code:
    collection": {
         "orderBy": "name",
          "order": "desc"
    } 
    
    to /custom/Espo/Custom/Resources/metadata/entityDefs/Document.json only affects the Document scope, but not the Document panel in the Account bottom panel, and I couldn't find anywhere else where to find this.

    Thanks.

  • emillod
    Active Community Member
    • Apr 2017
    • 1404

    #2
    You have to change file of entity in clientDefs directory.
    In this file you have to add this code:

    Code:
    "relationshipPanels":{[INDENT]"smsRates": {[/INDENT][INDENT=2]"filterList": [
    "all"
    ],
    "orderBy": "country",
    "asc": true[/INDENT][INDENT]}[/INDENT]
     
    },

    Comment

    • telecastg
      Active Community Member
      • Jun 2018
      • 907

      #3
      Hi, changing the collection "orderBy" setting at Document entityDefs should also change the order of display when the Document list is shown as a relationship panel in the Account scope.

      Espo uses the metadata settings for Document when building the collection to be displayed in any panel.

      I just tested this and it works fine.

      Try clearing cache and rebuild again, maybe the browser is pulling a cached version.

      emillod solution works as well and is a better solution if you don't want to alter the sort order of every place where a list of "Document" is displayed and just want to change the sort order in one particular display panel.

      Last edited by telecastg; 03-11-2021, 09:12 PM.

      Comment

      • emillod
        Active Community Member
        • Apr 2017
        • 1404

        #4
        Originally posted by telecastg
        Hi, changing the collection "orderBy" setting at Document entityDefs should also change the order of display when the Document list is shown as a relationship panel in the Account scope.

        Espo uses the metadata settings for Document when building the collection to be displayed in any panel.

        I just tested this and it works fine.

        Try clearing cache and rebuild again, maybe the browser is pulling a cached version.

        emillod solution works as well and is a better solution if you don't want to alter the sort order of every place where a list of "Document" is displayed and just want to change the sort order in one particular display panel.
        I thought about proposing solution "change in settings", but i thought that he is looking for changing something only in relation panel

        Comment

        Working...