Cases status field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • minbar
    Senior Member
    • Oct 2016
    • 110

    Cases status field

    Hi guys, quick question... In the Cases Status field the is a setting called 'Not Actual Options', can any one please tell me what it does?

    Many thanks..

    Gareth
  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hi.
    Could you provide a screenshot of where do you see this?

    Comment

    • emillod
      Active Community Member
      • Apr 2017
      • 1419

      #3
      Okay, you're talking about settings of entity, yes? There you can define status field - enum. And based on that you can for example group cases in kanban view

      Comment

      • minbar
        Senior Member
        • Oct 2016
        • 110

        #4
        Hi Maximus, sure…

        Comment

        • emillod
          Active Community Member
          • Apr 2017
          • 1419

          #5
          Ah, sorry, so you meant something different

          Comment

          • minbar
            Senior Member
            • Oct 2016
            • 110

            #6
            Originally posted by emillod
            Ah, sorry, so you meant something different
            No problem, thanks for responding….

            Comment

            • telecastg
              Active Community Member
              • Jun 2018
              • 907

              #7
              It is an array containing values to be used as "different from" definition for filtering purposes..... for example:

              In script application/Espo/Modules/Crm/SelectManagers/CaseObj.php
              Code:
              namespace Espo\Modules\Crm\SelectManagers;
              
              class CaseObj extends \Espo\Core\Select\SelectManager
              {
                  protected function boolFilterOpen(&$result)
                  {
                      return [
                          'status!=' => $this->getMetadata()->get(['entityDefs', $this->entityType, 'fields', 'status', 'notActualOptions']) ?? []
                      ];
                  }
              
                  protected function filterOpen(&$result)
                  {
                      $result['whereClause'][] = [
                          'status!=' => $this->getMetadata()->get(['entityDefs', $this->entityType, 'fields', 'status', 'notActualOptions']) ?? []
                      ];
                  }
              
                  protected function filterClosed(&$result)
                  {
                      $result['whereClause'][] = [
                          'status' => 'Closed'
                      ];
                  }
              }
              application/Espo/Modules/Crm/Resources/metadata/entityDefs/Case.json
              Code:
              "fields" {
                  ....
              
                  "status": {
                      "type": "enum",
                      "options": ["New", "Assigned", "Pending", "Closed", "Rejected", "Duplicate"],
                      "default": "New",
                      "style": {
                          "Closed": "success",
                          "Duplicate": "danger",
                          "Rejected": "danger"
                      },
                      "audited": true,
                      "fieldManagerAdditionalParamList": [
                          {
                              "name": "notActualOptions",
                              "view": "views/admin/field-manager/fields/not-actual-options"
                          }
                      ],
                      "notActualOptions": ["Closed", "Rejected", "Duplicate"]
                  },
              
                  ...
              }
              a Case is considered "Open" if the status value of the record is NOT contained in the array ["Closed", "Rejected", "Duplicate"]
              Last edited by telecastg; 07-26-2021, 02:29 PM.

              Comment

              • minbar
                Senior Member
                • Oct 2016
                • 110

                #8
                telecastg Brilliant, many thanks for the detailed answer!

                So I want to create a status of ‘Close Unresolved’ and based on what you said I will need to add that status to Not Actual Options so that the system knows it’s a ‘closed’ status right?

                Comment

                • telecastg
                  Active Community Member
                  • Jun 2018
                  • 907

                  #9
                  You're welcome minbar

                  Yes, if you create a 'Close Unresolved" status and also add it to the Not Actual Options, the filter "Open" will discard any Case with that status.
                  Last edited by telecastg; 07-26-2021, 02:30 PM.

                  Comment

                  • minbar
                    Senior Member
                    • Oct 2016
                    • 110

                    #10
                    Perfect, thanks again!

                    Comment


                    • telecastg
                      telecastg commented
                      Editing a comment
                      You're welcome

                      Not sure if it's redundant, but don't forget to add the new status first to the array "options" so you can choose it and then to the array "notActualOptions" so the filter "Open" will recognize it as 'Not Open".
                  • minbar
                    Senior Member
                    • Oct 2016
                    • 110

                    #11
                    That's what I did, nice to have confirmation that I did the right thing..

                    Comment

                    Working...