Hi,
I’ve got an issue that seems to me to be a bug. When creating a record selector module field, users can set a prefilter. This simplified SQL query should run on every interaction with the corresponding field, not just when the ‘Add record to module …’ page is loaded.
To give an example:
There are two basic modules: parent and child.
parent:
child:
The child module’s parentID field is a record selector to the parentID, setting the connection between the two tables.
I have two fields in my third module: a parentID record selector and a childID record selector. This child ID selector has a set prefilter record: parentID = ${record.values.parentID}
What I want to achieve is to choose a parentID and then choose a childID based on the previously selected parentID. I want to see only those childIDs that have the previously selected parentID.
Based on the tables I have provided above, if I chose parent p1, I want to see only c1 and c2 children when adding a new record.
I notice this query runs when loading the add new record page. The problem with this behavior is that no parentID is chosen at loading time. Thus, the parameter is undefined on the code level. See:
Note that if I choose a parentID then save the record with an empty childID, and then edit the existing record, the childID field is populated as expected; however, it is inconvenient to save and edit a record right away for this. See:
This prefilter query should be triggered whenever an element is selected from the parentID list, and then the options for the childID list should be reloaded.
I know this feature comes with an extra cost; however, manually choosing from a list of thousands of records is impossible.
If I’m wrong and this is the intended way of using the prefilter records, is there any way to solve my issue and achieve what I want?
Thank you for the help in advance.