Dynamic dropdown lists not working in SuiteCRM 8.0.4?

After my last topic I decided to make another try with SuiteCRM 8.0.4. It seems to me like dynamic dropdowns are not working (or at least are not defined like it was in 7.12). I followed this topic here to create my dropdowns: Dynamic Dropdown Creation - #6 by amariussi

I’d like to add additional fields to the Case module containing software we support for our customers as well as it’s versions. So here’s what I did:

  1. I created a custom field “software_name_c” as a standard dropdown list.
  2. I created software_name_list populated with couple of entries: cp - Software 1, cs - Software 2, wch - Software 3 (entry name - entry label).
  3. I created another custom field “software_version_c” as a dynamic dropdown list.
  4. I created software_version_list populated with: cp_1 - 1.0, cp_2 - 2.0, cp_3 - 3.0 and so on for every entry.
  5. For parent dropdown in “software_version_definition_c” I entered “software_name_c” as it’s the name of the field containing the master dropdown.
  6. I changed Edit View for the case, adding both dropdowns.

When I create a new case, I can choose software name without problems, but Version dropdown doesn’t show anything, it’s empty. If I try to enter the value manually, it gets deleted (quite understandable, as it is a dropdown with predefined values).
The same setup worked flawlessly in 7.12, so is it some bug or has anything changed between 7.x and 8.x regarding dynamic dropdowns?

I’ve seen a similar thing in SuiteCRM 8.1.0. But I get some subcategories working fine and some doing what you see - nothing at all.

I’ll list the relevant section of the /public/legacy/custom/include/language/en_us.lang.php file in case anyone has an idea.

What works fine:
Education
Health
Welfare

What fails to show ay subcategory at all:
ArtsMusic
SportRec
BlitheringFool

I’ve also performed a Quick Repair to no avail…

$app_list_strings[‘hcare_acct_cat’]=array (
‘’ => ‘’,
‘ArtsMusic’ => ‘Arts & Music’,
‘Education’ => ‘Education’,
‘Health’ => ‘Health’,
‘SportRec’ => ‘Sport & Recreation’,
‘Welfare’ => ‘Welfare’,
‘BlitheringFool’ => ‘Blithering Fool’,
);

$app_list_strings[‘hcare_acct_subcat’]=array (
‘ArtsMusic_Banjo’ => ‘Banjo Throwing’,
‘ArtsMusic_Collage’ => ‘Collage’,
‘Education_Primary’ => ‘School - Primary’,
‘Education_Secondary’ => ‘School - Secondary’,
‘Education_Ter_TAFE’ => ‘School - TAFE’,
‘Education_Ter_Uni’ => ‘School - University’,
‘Health_Hospice’ => ‘Hospice’,
‘Health_Doc_GP’ => ‘Doctor - GP’,
‘Health_Mental’ => ‘Mental Health’,
‘SportRec_Water’ => ‘Water Sports’,
‘SportRec_Facilities’ => ‘Sporting Facilities’,
‘Welfare_Child’ => ‘Child Welfare’,
‘Welfare_Financial’ => ‘Financial Aid’,
‘Welfare_Wildlife’ => ‘Wildlife Care & Rescue’,
‘BlitheringFool_Sponges’ => ‘Sponges’,
‘BlitheringFool_Floaties’ => ‘Floaties’,
);

Thanks for the info, at least I see I’m not alone with this issue :slight_smile: (Though I haven’t been so lucky and none of my dynamic dropdowns I tried to create in 8.x were working :wink: ).

Hey this is a bug in the suitecrm 8.x where it using parent dropdown list labels instead of dropdown list values. This is why for @HiltonT ArtsMusic , SportRec and BlitheringFool do not work because there labels and values are different.

In the core you can modify core/app/core/src/lib/fields/base/base-enum.component.ts line number 286
from

  option => String(option.value).startsWith(parentOptions[key])

to

  option => String(option.value).startsWith(key)

The function is createParentChildOptionsMap
And recompile the core

OR
find the js usage of createParentChildOptionsMap in compiled code and modify it
from

createParentChildOptionsMap(e,t){const n={};return Object.keys(e).forEach(i=>{n[i]=t.filter(t=>String(t.value).startsWith(e[i]))}),n}

to

createParentChildOptionsMap(e,t){const n={};return Object.keys(e).forEach(i=>{n[i]=t.filter(t=>String(t.value).startsWith(i))}),n}

Thank you for this find! I’ve tested it with editing .js files (sadly I’m not knowledgeable enough to recompile anything in SuiteCRM :wink: ) and it actually worked. One issue with 8.x down for me.