Hi FirstSpirit Community,
I’m working on a project where I need to dynamically populate the legal entity combo box based on the selected country combo box using FirstSpirit's <CMS_MODULE>.
Current Setup
I’ve set up two combo boxes in FirstSpirit:
- Country Combo Box (tt_country_list) pulls data from the privacy_country table.
- Legal Entity Combo Box (tt_legal_entity) should pull data from the privacy_legal_entity table, but it needs to be filtered by the selected country.
My Code
Here is the code I’m using in the module:
<CMS_MODULE>
<CMS_INPUT_COMBOBOX name="tt_country_list" hFill="yes" singleLine="no" useLanguages="no">
<CMS_INCLUDE_OPTIONS type="database">
<LABELS>
<LABEL lang="*">#item.countryName </LABEL>
</LABELS>
<TABLE>webworld.privacy_country</TABLE>
</CMS_INCLUDE_OPTIONS>
<LANGINFOS>
<LANGINFO lang="*" label="Select Country" description="Select Country"/>
</LANGINFOS>
</CMS_INPUT_COMBOBOX>
<CMS_INPUT_COMBOBOX name="tt_legal_entity" hFill="yes" singleLine="no" useLanguages="no">
<CMS_INCLUDE_OPTIONS type="database">
<LABELS>
<LABEL lang="*">#item.entity_name</LABEL>
</LABELS>
<QUERY name="">
</QUERY>
<TABLE>webworld.privacy_legal_entity</TABLE>
</CMS_INCLUDE_OPTIONS>
<LANGINFOS>
<LANGINFO lang="*" label="Select your Entity" description="Select your Entity"/>
</LANGINFOS>
</CMS_INPUT_COMBOBOX>
</CMS_MODULE>
Issue
The problem is that I can't seem to figure out how to properly filter the legal entity combo box based on the selected country. I’ve attempted to use the <QUERY> tag, but I’m unsure how to structure it to reference the selected country in the first combo box (tt_country_list).
What I Need
Could anyone guide me on how to:
- Properly filter the privacy_legal_entity table based on the selected country from the privacy_country combo box?
- Use the correct FirstSpirit query or filtering mechanism to achieve this?
Any insights or examples would be greatly appreciated!
Thanks in advance for your help.