Announcement

Collapse
No announcement yet.

Portal Dashlet Order By Custom Field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Portal Dashlet Order By Custom Field

    Hello, as in the screenshot below, how do you get a calculated field you created for an entity to show up in the 'Order' drop-down? My calculated field does not show up there.

  • #2
    It's not possible at the moment. It does not show notStorable fields.

    Comment


    • #3
      That is unfortunate. I don't see any reason why sorting would not work given a field definition of entity defs such as the one below where we specified "order". Right now, I have to set the field "notStorable": false, so it creates a database column even though it is 'calculated' in order to get this to work.

      Code:
      "registrationNumberSiteNumber": {
      "type": "varchar",
      "notStorable": true,
      "readOnly": true,
      "trim": true,
      "select": {
      "select": "CONCAT:(rmc.registrationNumber,'-',siteNumber)",
      "joins": [
      [
      "RadiationMachineCertificate",
      "rmc",
      {
      "radiationMachineLocation.radiationMachineCertificateId:": "rmc.id",
      "rmc.deleted": false
      }
      ]
      ]
      },
      "order": {
      "order": [
      ["rmc.registrationNumber","{direction}"],
      ["siteNumber","{direction}"]
      ],
      "joins": [
      [
      "RadiationMachineCertificate",
      "rmc",
      {
      "radiationMachineLocation.radiationMachineCertificateId:": "rmc.id",
      "rmc.deleted": false
      }
      ]
      ],
      "additionalSelect": ["rmc.registrationNumber","radiationMachineLocation.siteNumber"]
      },
      "where": {
      "LIKE": {
      "joins": [
      [
      "RadiationMachineCertificate",
      "rmc",
      {
      "radiationMachineLocation.radiationMachineCertificateId:": "rmc.id",
      "rmc.deleted": false
      }
      ]
      ],
      "whereClause": {
      "CONCAT:(rmc.registrationNumber,'-',siteNumber)*": "{value}"
      },
      "distinct": true
      },
      "NOT LIKE": {
      "joins": [
      [
      "RadiationMachineCertificate",
      "rmc",
      {
      "radiationMachineLocation.radiationMachineCertificateId:": "rmc.id",
      "rmc.deleted": false
      }
      ]
      ],
      "whereClause": {
      "CONCAT:(rmc.registrationNumber,'-',siteNumber)!*": "{value}"
      },
      "distinct": true
      },
      "=": {
      "joins": [
      [
      "RadiationMachineCertificate",
      "rmc",
      {
      "radiationMachineLocation.radiationMachineCertificateId:": "rmc.id",
      "rmc.deleted": false
      }
      ]
      ],
      "whereClause": {
      "CONCAT:(rmc.registrationNumber,'-',siteNumber)": "{value}"
      },
      "distinct": true
      },
      "<>": {
      "joins": [
      [
      "RadiationMachineCertificate",
      "rmc",
      {
      "radiationMachineLocation.radiationMachineCertificateId:": "rmc.id",
      "rmc.deleted": false
      }
      ]
      ],
      "whereClause": {
      "CONCAT:(rmc.registrationNumber,'-',siteNumber)!=": "{value}"
      },
      "distinct": true
      },
      "IS NULL": {
      "joins": [
      [
      "RadiationMachineCertificate",
      "rmc",
      {
      "radiationMachineLocation.radiationMachineCertificateId:": "rmc.id",
      "rmc.deleted": false
      }
      ]
      ],
      "whereClause": {
      "CONCAT:(rmc.registrationNumber,'-',siteNumber)=": null
      },
      "distinct": true
      },
      "IS NOT NULL": {
      "joins": [
      [
      "RadiationMachineCertificate",
      "rmc",
      {
      "radiationMachineLocation.radiationMachineCertificateId:": "rmc.id",
      "rmc.deleted": false
      }
      ]
      ],
      "whereClause": {
      "CONCAT:(rmc.registrationNumber,'-',siteNumber)!=": null
      },
      "distinct": true
      }
      }
      }
      },​

      Comment


      • #4
        In most cases notStorable is not sortable. Currently we do not have notSortable parameter. This problem will be solved once such a parameter is introduced. The "order" parameter is not a parameter for a frontend, once it may became hidden. And it's not the only parameter that may have effect on whether the field is sortable.
        Last edited by yuri; 03-21-2024, 08:42 PM.

        Comment

        Working...
        X