Sorry, but there's no real way to help you without knowing a great deal more about your database. Please describe the design of your database and what you need to do in much more detail.
Thanks for your reply. Please find below the details of the database.
Table Building Levels:
- Level_ID (Values= 1,2,3,4,5,6,7)
- Level_Name (Level 1, Level 2, ...)
- Floor Plan (Container field which is a picture)
Table Building Rooms:
I have created a portal to display the rooms by Level. I want to add a drop down or pop up menu to be able to select a Floor Level. I specified the value list to use data from Building Levels table and from the field Level_Name.
The issue that I have is that when I switch to browse mode to test if the drop down works, the records of the field Level_Name changes when I select one Level from the drop down. Then, when I check the data, I see that instead of having Level 1, Level 2, Level 3, Level 4.... Level 7 as records in the field Level_Name I have Level 2, Level 2, Level 3, Level 4....Level 7. ==> The records have been changed.
Also I am having trouble linking the drop down list to the portal. Could you please help. I have attached a Screenshot of My tables and the relationship?
First, I would make a change in what you have described for your fields and tables:
Table Building Rooms:
- Level ID
have created a portal to display the rooms by Level.
My guess here isthat you have a portal to Building Rooms on your Building Levels layout.
If so, then when you want to "select a floor level" it would appear that you want to find the correct record in Building Levels for the level that you select from the drop down list.
I could be misunderstanding you, but if that is correct, then you are modifying data instead of performing a find. Enter find mode first, then select your level, then click Perform Find to perform the find. These manual steps can also be automated with a script so that all you do is select the value and that record will be found on your layout.
Yes, you understood properly. I think I understand the scripts concept but what I don't understand is how to link the script to the action of selecting a level from the drop down. Could you please advise ? Should I just add the scripts to the Layout?
When you are in find mode, you can enter or select data in a field without changing data in an actual record. These type of scripts usually start with data entered while in browse mode so you have to add a field to your table in order to select or enter data in it without changing data in the Level Name (or Level ID) field. And it's simplest to give this new field global storage as global fields can be directly referenced in find mode by the type of scripts shown in this thread of scripted find examples: Scripted Find Examples
Thus, you can add a new field to your table. Specify global storage for it and then add it to your layout and format it with a drop down list or pop up menu. Then you can set a script trigger on the field to perform the scripted find. OnObject Modify is a good trigger to use for pop up menus. Drop Down lists that permit typing data into the field should use OnObjectSave.
Thanks again for the support. I am stuck at the script stage. I have added the global storage field to the Table and to the Layout with a drop dow menu design. However, when setting up the script Perform Find, I am not sure what to specify as a criteria since it is not linked to a data entry but to a selection from an existing list (in other words, I don't know what to put as a criteria for Finding records). I would like to display the data related to the Floor level selected from the drop down.
Please find attached a screenshot of the scripts stage where I am stuck.
Could you please advise?
You have things reversed in your set field step. Global Field should be the field where you have your drop down list for selecting a level.
Niveau_nom should be the field where you have entered the name of the level in your Niveaux du Palais table.
And then your set field step should look like this:
Set Field [ Niveaux du Palais::Niveau_nom ; Niveaux du Palais::Global Field ]
It works!! wonderful, Thanks a lot for your support!
Regarding the script you helped me create in order to display a pop-up menu allowing to select a Floor level, I noticed that you have to click elsewhere to close the pop-up menu after your selection. Could you help with the script step required to have it close when the user selects a floor level?
You shouldn't have to click elsewhere with a pop up menu if you use the OnObjectModify trigger. That description matches what you will get if you use OnObjectSave with a drop down list where you permit typing data into the field. There's no way for FileMaker to tell that the user is finished typing in data and thus OnObjectSave is not tripped until the user exits the field--which would be by clicking elsewhere or pressing a tab/enter/return key if such is set in the Inspector's behavior settings to exit the field when pressed.
The script trigger I used is the OnObjectModify.(See screenshot)
Should I add a scipt step "End" or "End if" ???
I think that I am misunderstanding your question. Am I correct that the script runs correctly but that the pop up menu remains popped up after the records have been found?
If so, add a commit records step as the last step of the script and see if that makes any difference.
I think I am the one explaining it wrong. The issue with the pop up menu not closing after selecting a value Was noticed on the iPad with FileMaker GO. Please see screenshot. Could you please advise?