How to set a default value for dynamic fields?
I'm using a dynamic field in a page view and I need to specify a default value for this dynamic field (Choice-dynamic) but I don't have this option... any idea how to do it?
Here's a screenshot of my options for the dynamic field:
I also checked in the options of the page view, to see if there was a section to run a script/function on page loading (to set a value for the field in question, if the option of a default value does not exist in the field itself), but I also came up empty-handed. I found nothing:
Any help would be appreciated!
Thanks in advance
9 replies
-
Hi, is there a specific record of the 'Saisons' Table that you want to set as default?
-
Use the table level Trigger on new record: and add this code
'Saison a afficher' := 8
Regards John
-
said:
It actually doesn't work, since I'm not trying to set a default value for a new record, but I'm using the dynamic field (dynamic choice) to change parameters in the view field (see screenshot)Making sure I understand what you want.
You are in a table that has a view element called Vue production.
You have a dynamic field called Saison a afficher. Is this in the main table or in the subtable that Vue production shows?
If it is in the main table, what is the name of the dynamic choice field in Vue production?
Which dynamic field do you want set to choice 8?
Can you upload a sample db?
-
Hello ! Thanks Fred for your reply
So, I'm trying to explain better my situation :
I've created a page with a kind of dashboard, which displays data from a table called Spectacles. In this page, I use a View element to display the data and I've added a dynamic field (using information from another table, called Saisons) to filter the view.
That's the code of my Dynamic value (calling the table Saisons)
select Saisons where text(Statut) != "n/d"
And that's the code of the formula in my view element :
let choixsaison := text('Saison à afficher'); select Spectacles where text(Saison) = choixsaison
It works fine ! But when I open the dashboard, the dynamic field is empty, because I can't set a default value, so the view is empty too... To save me some clicks every time one open the dashboard, I'd like the default dynamic view not to be empty, but with the value 8 from the table Saisons (= 2024-2025). Any idea how to do that ?
Content aside
-
1
Likes
- 11 hrs agoLast active
- 9Replies
- 82Views
-
4
Following