How to set a single record as default value on a lookup query

Hello,

On a form field, when using a _LookupQuery with a query as a datasource, I noticed that when the result of the query is a single record, this record appears as the default value in the field. This is very practical.

Unfortunately, I deleted a field with this kind of lookup query that was working well and recreated it with, I think, the exact same components.

However, when the result of the query is a single record, it is not displayed as the default value like it used to. Do you have any idea what I should look at to bring back this “default value behavior”?

I reproduced this issue in the attached sample (this is the same sample as I provided in Cannot create a Dependent Field with a Lookup on Dependent Tables - #22 by JeanXXIV ).

I have only one ‘Leader’, so when I create a new Task (in the Task2s menu), this leader should appear by default, but it does not.

Thanks for your help,
Jean

DependentField-on another page.fdf (3.5 MB)

I found my problem! At the form level, the field must be mandatory. Display : Required if = true.

yes, this is quite logical :slight_smile:

Awesome, I was just about to look into this for you!

Kind regards,

Jo