Dynamic Dropdowns: very difficult to understand

Following instructions, read 1000 times posts and explainations. But very difficult.

I have the following configurations:
1 dropdown parent, called pipeline_list, with the following values: Product, Service, Contract, Investors, Distributors.

1 dropdown child, called stages_pipeline with the following: P-Engage, P-Offer, P-Contract, … ,I-Engage, I-pitch, I-NDA, etc.etc

P stands for Product, I for investors, S for service, C for contracts, I for investors and so on.

Then I created inside the module opportunity, using studio, one field, type dropdown, for pipeline_list. This field is called pipeline_list_c
Then I created in the module opportunity, using studio, one field, type dynamic dropdown, called stage_pipeline_c , where the dropdown list is stages_pipeline, and the parent dropdown is pipeline_list_c.

What it happens is that setting the value “Product” (edit mode of opportunity) the pipeline works, The Service also works, but the pipeline Investors doesn’t work. Nothing appears in the dynamic dropdown box (create new opportunity) if the pipeline selected is Investors.

In addition, I cannot understand how can the dynamic dropdown work. Because the value of the field in stages_pipeline is P-Engage, NOT Product-Engage. And the value of the parent is Product.

So for me everything is obscure. Can someone help me? And what is the function of the “-”? Is it a separator?

Thank you

Hi,
the dynamic dropdowns use the database key instead of the label for the matching. If needed, I can prepare a short tutorial on that and post it here - I saw similar questions in the past about that.

1 Like

Maybe this could be in the official Documentation, instead of spreading out the necessary information across many forum posts

That’s the whole point of having a wiki-style editable Docs site :slight_smile:

1 Like

That’s great. This is the solution thank you.
Indeed, I called the database key Product_1, Product_2 etc. but I wrote wrong Investors. And you don’t have to use labels, but keys.

That’s why it didn’t work.

I think a tutorial in official documentation of SuiteCRM could help a lot people approaching suitecrm, a fantastic crm.

Hi,
glad you got it working :slight_smile:

Still, here is a short tutorial for everyone:


It’s important to understand that each dropdown-option consists of a key-value-pair, those are visible in the studio. The key is used on database level, while the value is shown in the UI (the studio calls them “item name” and “display label”).
Spoiler: In order to use dynamic dropdowns, those keys have to use common prefixes.

Let’s start with a regular dropdown field. I’ve added this field using the studio and added a list with the following options:

chrome_wlI5dxwlug

This step is pretty straight-forward. So let’s add the first dynamic dropdown field like this:

!
chrome_nXFbTyiQDF
The following steps are important:

  • “Data Type” has to be “Dynamic DropDown”
  • “Parent DropDown” has to be set to our first field, “dd_country_c” (so that we only display cities that are in the chosen country).

Further, the selected list (“dd_city_list”) has to use the exact same keys as defined in “dd_country_list” as a prefix.
A new city-option for the US would therefore have to use a key like “usa_somename”.

You can extend this behavior again, for example with street names. In this case, the full item name from the city-list has to be repeated as a prefix, just like this:

chrome_iKksjbfxF5
For this third dropdown, the city-field is the proper parent.

After adding those field to the EditView, you should be able to test those dependencies:

Ua61icdC8Y

3 Likes

Nice! Copy pasted to my Google docs in case it doesn’t make it to official Wiki :joy:

2 Likes

Here’s a new video just posted:

2 Likes

Muito obrigado pelas explicações ! Ajudou bastente Amigo

2 Likes