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

Multiple selection of dropdown items gets cut upon save in Workflow condition #7878

Open
zorodude opened this issue Sep 17, 2019 · 4 comments
Labels
Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Type:Bug Bugs within the core SuiteCRM codebase

Comments

@zorodude
Copy link

Issue

When creating a condition for "Leads | Status | Equal To | One of " and where the "value" refers to a dropdown list, the total amount of selected items during editing get dropped / shortened when saving the workflow. Might be string related, since it's an inconsistent number of items that remain selected.

Expected Behavior

Selecting the full list of dropdown items from the "Status" field should result in the full selection appearing in the detail (non-editing) view, as well as being used for criteria to execute the workflow.

Actual Behavior

After saving the workflow, the list is truncated to a smaller number of items (in my case, anywhere from 9 to 17 items).

Steps to Reproduce

  1. Create a new workflow for the Leads module.
  2. Set the condition to
    module: Leads
    field: status
    operator: Equal to
    type: one of
    value: (select long list of items from the dropdown list)
  3. Add an action to modify the Leads record, and copy the field value to a custom field as text
  • Add action: "Modify Record"
  • Record Type: "Leads"
  • "(a custom field)" | "Field" | "Status"
  1. Save
  2. Review the list - it will be only part of selection you made.

Context

As part of cleaning up historical data, but preserving it temporarily, I'm copying the value from the "Status" field to a custom field. The workflow looks at the selected value in the Status field, and copies it to a custom field as text field. The workflow works, but won't retain the fully selected items of the Status dropdown.

Here's the sample list of items in in the dropdown (note the first line is blank):

CSF09 DECLINE
0% Contacted
0% DeclinedCSF07
50% Requested_Info
75% Confirming
Active
Assigned
Contacted
Converted
CPMC07Reg
CSF08 Comp
CSF08 DECLINE
CSF08 Speaker
CSF09 Registered Comp
CSF10 Registered Delegate
CSF10 Speaker Prospect
CSF10 Sponsor
CSF11 Confirmed Speaker
CSF11 Confirmed Sponsor
CSF11 Delegate - DECLINE
CSF11 Registered Delegate
CSF12 Comp
CSF12 Comp - DECLINE
CSF12 Comp Prospect
CSF12 Confirmed Speaker
CSF12 Registered Delegate
CSF12 Speaker - DECLINE
CSF12 Speaker Prospect
CSF12 Sponsor - DECLINE
CSF12 Sponsor Prospect
CSF12_Delegate- DECLINE
CSF13 Comp
CSF13 Comp Prospect
CSF13 Confirmed Speaker
CSF13 Confirmed Sponsor
CSF13 Delegate - DECLINE
CSF13 Registered Delegate
CSF13 Speaker Prospect
CSF13 Sponsor - DECLINE
CSF13 Sponsor Prospect
CSF13_Speaker - DECLINE
CSFX 2014 Comp - Confirmed
CSFX 2014 Comp Decline
CSFX 2014 Comp Prospect
CSFX 2014 Registered Delegate
CSFX 2014 Speaker - CONFIRMED
CSFX 2014 Speaker - DECLINE
CSFX 2014 Speaker Prospect
CSFX 2014 Sponsor - CONFIRMED
CSFX 2014 Sponsor - DECLINE
CSFX2015 Comp - Declined
CSFX2015 Comp Prospect
CSFX2015 Delegate Confirmed
CSFX2015 Delegate Declined
CSFX2015 Speaker Prospect
CSFX_2014 Delegate - DECLINE
Dead
DeclinedCPMC07
In Process
Inactive
New
Qualified
Recycled
Unqualified

Your Environment

  • SuiteCRM Version used: 7.11.4
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Firefox 69, Chrome 76
  • Environment name and version (e.g. MySQL, PHP 7): PHP 7.1.2
  • Operating System and version (e.g Ubuntu 16.04): Windows NT T1-IIS 10.0 build 17763 (Windows Server 2016) AMD64
@cameronblaikie cameronblaikie added Type:Bug Bugs within the core SuiteCRM codebase Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds labels Sep 19, 2019
@pstevens71
Copy link

Here's link to a discussion in forum about the issue.

https://suitecrm.com/suitecrm/forum/suitecrm-7-0-discussion/27484-select-one-of-in-workflow

Seems there is a limitation in DB Field. The table aow_conditions is set to varchar limit of 255 characters. The table should be changed to a text field which allows more characters. A dropdown with 20 or so values could easily max this out the way it's set up now as varchar field type.

@AlxGr-OS
Copy link

AlxGr-OS commented Sep 20, 2019

It should be solved by changing file /modules/AOW_Conditions/vardefs.php
https://github.com/salesagility/SuiteCRM/commit/07c88f3b0edb49c51b4ae60d180cb0ab5ea27cd2

lines 142 - 160 on variable value definitions:

  'value' =>
  array(
    'required' => false,
    'name' => 'value',
    'vname' => 'LBL_VALUE',
    'type' => 'varchar',
    'massupdate' => 0,
    'comments' => '',
    'help' => '',
    'importable' => 'true',
    'duplicate_merge' => 'disabled',
    'duplicate_merge_dom_value' => '0',
    'audited' => false,
    'reportable' => true,
    'unified_search' => false,
    'merge_filter' => 'disabled',
    //'len' => '255',
    'len' => '1000',
    'size' => '20',
  ),

@AlxGr-OS
Copy link

AlxGr-OS commented Sep 20, 2019

BTW. A similar issue exists on the reports module. When you want to report on multiple options and characters in conditions exceeds the 255 threshold. It could be solved by changing the length on file /modules/AOR_Conditions/vardefs.php, lines 156 -173 on on variable value definitions on a similar way to the proposed above.
https://github.com/salesagility/SuiteCRM/commit/7cd12c87c171932af4c72bf6725eedda3589368e

@mayerelyashiv
Copy link

You have also to set the
'type' => 'text',
and do a Quick Repair

'value' =>
  array(
    'required' => false,
    'name' => 'value',
    'vname' => 'LBL_VALUE',
    'type' => 'text',
    'massupdate' => 0,
    'comments' => '',
    'help' => '',
    'importable' => 'true',
    'duplicate_merge' => 'disabled',
    'duplicate_merge_dom_value' => '0',
    'audited' => false,
    'reportable' => true,
    'unified_search' => false,
    'merge_filter' => 'disabled',
    //'len' => '255',
    'size' => '20',
  ),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Type:Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

5 participants