Hi,
I have created 3 tables in Dataverse,
1. Country
Column - Name (Single Line Text)
2. State
Column - Name (Single Line Text), Country (Lookup)
3. City
Column - Name (Single Line Text), State (Lookup)
I need to configure Cascading Dropdown for City. For example, if the end-user selects any country, the state dropdown options should be filter-based on selected Country, then the end-user selected the state city dropdown should be a filter-based on the selected State. (That's easy!)
However if the state is not filtered, the end-user should be able to select based on all cities of that the selected country..
Is this possible with model driven app? May be with JS web resource?
@Anonymous If the relationship between Product Group and Product Code is a simple 1:N, you don't need script to apply the filter on the Product Code lookup on Order. This can be achieved by simple form configuration.
Go into the properties for the Product Code lookup on the Order form, and simply select the filtering properties to only allow selection of Product Codes that are related to the selected Product Group.
Hope that makes sense.
Hi Parvez,
I changed to code. No errors now. However I am getting all the selections instead of the filtered critieria.
Hi Parvez,
I am running into some troubles with filter.
I have a ProductGroup entity and a ProductCode entity with a Productgroup lookup field to the ProductGroup entity.
I have an Order form with ProductGroup field ("cas_productgroup_order") and based on this field I will filter the Productcode field ("cas_productcode_order").
I have the following code:
@Anonymous Yes for accessing column controls and attribute values on the form, using the column logical name rather than schema name. The schema name is generally for access the data via the Web API
Hi Parvez
Thank you for your help. I used that on another code block.
I ticked that checkbox, and pass also the logical name of the lookup field and it did not spit out an error.
Should the logical name be used instead of schema name? If I use the schema name, it spit out (Cannot read properties of null (reading 'getValue')).
@Anonymous If you are calling this function directly from an event handler in your Model Driven App form, in the form designer, go to the event handler where this function is called. You should see a check box to check that will pass the execution context object to the function
If you're calling this function from another function, the make sure the function call passes in the execution context object
Hi Parvez
it seem like I am not. What should I do? My objective is to get value of the lookup field "cas_productgroup".
Regards.
@Anonymous Are you passing in the executionContext object when you wire up this function in your form?
Thank you. Let me try that.
Aside from this, I am trying to query a lookup field:
As per others, whilst they will still work for now avoid using the deprecated features, also to pass the Solution Checker javascript functions also need to 'use strict' but less of an issue than the deprecated api calls.
at least one issue with your FetchXML query, the value provided to the Like operator should be wrapped in '%' e.g. ........ operator='like' value='%" + Productgroup + "%' ......
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473