Workflow sets enum key and not label #5177

Open
opened 2026-02-20 16:30:59 -05:00 by deekerman · 1 comment
Owner

Originally created by @JackBuchanan on GitHub (Mar 21, 2024).

Issue

When a workflow creates or modifies a record and when the WF action is configured to set the field value to another when it is an enum it sets the key rather than the label

E.g.
Field name -> Field -> Field name(Opportunity Name -> Field -> Opportunity Type)

Expected Behavior

Unless the target field is also an enum then the enum Label should be used rather than they key
e.g.
Opportunity Name -> Field -> Sales Stage
Results in the opportunity name being set to "Closed Won"

Actual Behavior

Unless the target field is also an enum then the enum Label should be used rather than they key
e.g.
Opportunity Name -> Field -> Sales Stage
Results in the opportunity name being set to "closed_won"

Possible Fix

Steps to Reproduce

  1. Create workflow
  2. Set WF to modify record using an enum
  3. See the workflow set the enum key to the value
    image

Context

Set incorrect value when workflow is executed

Your Environment

  • SuiteCRM Version used: 7.14.3
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Chrome
  • Environment name and version (e.g. MySQL, PHP 7): MySQL, PHP 8.2
  • Operating System and version (e.g Ubuntu 16.04): 20.04
Originally created by @JackBuchanan on GitHub (Mar 21, 2024). <!--- Provide a general summary of the issue in the **Title** above --> <!--- Before you open an issue, please check if a similar issue already exists or has been closed before. ---> <!--- If you have discovered a security risk please report it by emailing security@suitecrm.com. This will be delivered to the product team who handle security issues. Please don't disclose security bugs publicly until they have been handled by the security team. ---> <!--- Please be aware that as of the 31st January 2022 we no longer support 7.10.x. New issues referring to 7.10.x will only be valid if applicable to 7.12.x and above. If your issue is still applicable in 7.12.x, please create the issue following the template below --> #### Issue When a workflow creates or modifies a record and when the WF action is configured to set the field value to another when it is an enum it sets the key rather than the label E.g. Field name -> Field -> Field name(Opportunity Name -> Field -> Opportunity Type) <!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug --> <!--- Ensure that all code ``` is surrounded ``` by triple back quotes. This can also be done over multiple lines --> #### Expected Behavior Unless the target field is also an enum then the enum Label should be used rather than they key e.g. Opportunity Name -> Field -> Sales Stage Results in the opportunity name being set to "Closed Won" <!--- Tell us what should happen --> #### Actual Behavior Unless the target field is also an enum then the enum Label should be used rather than they key e.g. Opportunity Name -> Field -> Sales Stage Results in the opportunity name being set to "closed_won" <!--- Tell us what happens instead --> <!--- Also please check relevant logs (suitecrm.log, php error.log etc.) --> #### Possible Fix <!--- Not obligatory, but suggest a fix or reason for the bug --> #### Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug include code to reproduce, if relevant --> 1. Create workflow 2. Set WF to modify record using an enum 3. See the workflow set the enum key to the value ![image](https://github.com/salesagility/SuiteCRM/assets/32680276/724a5f57-3cbf-48bc-96d3-1ac19a089ae0) #### Context Set incorrect value when workflow is executed <!--- How has this bug affected you? What were you trying to accomplish? --> <!--- If you feel this should be a low/medium/high priority then please state so --> #### Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * SuiteCRM Version used: 7.14.3 * Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Chrome * Environment name and version (e.g. MySQL, PHP 7): MySQL, PHP 8.2 * Operating System and version (e.g Ubuntu 16.04): 20.04
Author
Owner

@serhiisamko091184 commented on GitHub (Mar 21, 2024):

Hi @JackBuchanan

thanks for raising the issue!

Regards,
Serhii

@serhiisamko091184 commented on GitHub (Mar 21, 2024): Hi @JackBuchanan thanks for raising the issue! Regards, Serhii
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#5177
No description provided.