How to bring cascading dropdowns filtered when editing a saved record?

How to bring cascading dropdowns filtered when editing a saved record?

  

I already know how to set cascading dropdowns, but and when I already have a saved record. How to bring these dropdowns filtered when editing a saved record in a screen detail?

We all know that when loading (Preparation), the Form.Record.ParentFieldId used to filter the second dropdown in its Aggregate is not set yet.

Thanks!!!

Solution

Hello Wilbert.

This is a classical problem.

If you use the aggregates to filter, than changing in the form does not work.
If you use the form, entering the page will not filter correctly, as you found, because the form is not set yet.

An easy way to solve this is to use the Form, and set the form relevant values in the preparation before executing the aggregates that need those values to filter, based on what comes from the record data (if it exists). To optimize, you can use the IsLoadingScreen function. It returns True only if the page is being load (navigate to).

Cheers.

Solution

Hi Eduardo,

I have just woke up and did exactly that (...set the form relevant values in the preparation before executing the aggregates...). I was coming here to cancel this post when then... Your full and intelligent explanation has been presented!!!

Thanks!!!!

haha

Nothing like a good night's sleep ;)

Cheers