Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case Status Not Saving #426

Closed
ctucker1984 opened this issue Jan 27, 2024 · 3 comments
Closed

Case Status Not Saving #426

ctucker1984 opened this issue Jan 27, 2024 · 3 comments
Labels
Area: Cases Issues & PRs related to all things regarding the Cases Module Priority:Important Issues & PRs that are important; broken functions; errors; there are workarounds Status: Team Investigating Labels for issues in which the Core Team are investigating / Intend to Investigate Type: Bug Something isn't working

Comments

@ctucker1984
Copy link

Issue

I’m finding that v8.5.0 (and 8.4.2) don’t save the case status when it’s updated in an edit on screen.

Expected Behavior

The case status should be saved into the DB when it’s selected by the user on screen.

Actual Behavior

The CRM seems to retain the state, but not the status. I see that in the dropdown list editor, status is a hybrid value of state_status (ex: Open_Assigned). This is so that certain statuses are available subordinate to certain corresponding states.

In the DB, the state is stored independently in column state with a value of Open, and the status is stored as the hybrid construction in column status which should show Open_Assigned.

I was able to capture the save operation via the log (set level to Info). While I don’t see errors, I do see a SQL query which contains an offending value:

UPDATE cases SET 
`name`='PDI Test',
`date_modified`='2024-01-27 07:54:47',
`modified_user_id`='1',
`created_by`='ceab0b19-fa61-2373-9970-65838b281334',
`description`='Perform Pre-Delivery Procedures in Assigned Tasks',
`assigned_user_id`='ceab0b19-fa61-2373-9970-65838b281334',
`type`='pdi',
`status`=NULL,
`priority`='P1',
`resolution`=NULL,
`work_log`=NULL,
`account_id`='66a1efda-f817-25c1-2496-5e18dacab4c9',
`state`='Open',
`contact_created_by_id`=''
WHERE  cases.id = '4600f72c-56b6-6970-4dee-65b45c09db90' AND deleted=0

As you can see, the `status`=NULL value is incorrect, and is the obvious cause for the incorrect value to be submitted into the database.

Following the advice of user pgr on SuiteCRM's Community Forum, I captured a network request in browser developer tools. I see here that the request from the front end into the back end system has not captured the field value:

{
  "operationName": "saveRecord",
  "variables": {
    "input": {
      "module": "cases",
      "attributes": {
        "module_name": "Cases",
        "object_name": "Case",
        "id": "4600f72c-56b6-6970-4dee-65b45c09db90",
        "name": "PDI Test",
        "date_entered": "2024-01-27 01:27:59",
        "date_modified": "2024-01-27 17:40:33",
        "modified_user_id": "1",
        "modified_by_name": { "user_name": "Chris Tucker", "id": "1" },
        "created_by": "ceab0b19-fa61-2373-9970-65838b281334",
        "created_by_name": {
          "user_name": "REDACTED",
          "id": "ceab0b19-fa61-2373-9970-65838b281334"
        },
        "description": "Perform Pre-Delivery Procedures in Assigned Tasks",
        "deleted": "",
        "assigned_user_id": "ceab0b19-fa61-2373-9970-65838b281334",
        "assigned_user_name": {
          "user_name": "REDACTED",
          "id": "ceab0b19-fa61-2373-9970-65838b281334"
        },
        "case_number": "393",
        "type": "pdi",
        "status": "",
        "priority": "P1",
        "resolution": "",
        "work_log": "",
        "suggestion_box": "",
        "account_name": {
          "name": "REDACTED",
          "id": "66a1efda-f817-25c1-2496-5e18dacab4c9"
        },
        "account_name1": "",
        "account_id": "66a1efda-f817-25c1-2496-5e18dacab4c9",
        "state": "Open",
        "case_attachments_display": "",
        "case_update_form": "",
        "contact_created_by_name": { "name": "", "id": "" },
        "contact_created_by_id": "",
        "update_text": "",
        "internal": "",
        "aop_case_updates_threaded": "",
        "cev01_vehicles_cases_name": { "name": "", "id": "" },
        "cev01_vehicles_casescev01_vehicles_ida": "",
        "editable": true
      },
      "_id": "4600f72c-56b6-6970-4dee-65b45c09db90"
    }
  },
  "query": "mutation saveRecord($input: saveRecordInput!) {\n  saveRecord(input: $input) {\n    record {\n      attributes\n      favorite\n      id\n      _id\n      module\n      acls\n      __typename\n    }\n    __typename\n  }\n}"
}

Possible Fix

I don't know the codebase well enough to suggest one. I suspect this is in the java scripting which handles the onSave() event.

Steps to Reproduce

  1. Open a case record from an imported dataset with valid statuses per record.
  2. Edit, or quick edit. Either works.
  3. Select a case status
  4. Save
  5. Record refreshes and does not retain the new status value.

Context

My users cannot save case statuses, which makes it impossible for his CRM to trigger "send to billing" workflows.

Environment

  • SuiteCRM 8.5.0
  • BlueHost Linux 4.19.286-203.ELK.el7.x86_64 x86_64
  • Apache 2.4.58
  • MySQL 5.7.23-23
  • PHP 8.1 (Tried with 7.4 and 8.2 also)
@johnM2401 johnM2401 added Type: Bug Something isn't working Priority:Important Issues & PRs that are important; broken functions; errors; there are workarounds Area: Cases Issues & PRs related to all things regarding the Cases Module labels Jan 30, 2024
@gemartin21 gemartin21 added the Status: Team Investigating Labels for issues in which the Core Team are investigating / Intend to Investigate label Jan 30, 2024
@johnM2401
Copy link

Hey!
For reference, this seems like it is likely related to / a possible duplicate of: #381
Thanks again for raising this.

@chris001
Copy link
Contributor

Should be fixed by #382

@johnM2401
Copy link

Hey @ctucker1984 !
Thank you for raising this ticket.

I'm going to close this off as the issues with Dynamic Dropdowns (including Case State/Status) have now been resolved with the changes to Enum-type fields in the latest release (8.6.0)

See gif, showing Core and Custom Dynamic Dropdowns on Cases:
dynamicDD

However, if you are still experiencing Dropdown / Dynamic Dropdown related issues on this release, please let us know and we can re-investigate.

Thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Cases Issues & PRs related to all things regarding the Cases Module Priority:Important Issues & PRs that are important; broken functions; errors; there are workarounds Status: Team Investigating Labels for issues in which the Core Team are investigating / Intend to Investigate Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants