Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Creating custom drop-down lists and layouts


This topic is 6368 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello!

I have a people-table that has the following fields; Firstname, Surname, ID, Salary and SalaryHistory. They are all text fields.

Now I want to create a custom layout that allows me to modify my people-info. At the top of the page I want a drop down list that contains the first name and surname of all people in the list. When clicking a person in the list I want the layout to jump to that person (record) in the table. The drop down list should be read only, so that modifying people in it is not possible.

The layout will have fields for the first name, surname, ID, and salary for each person. It will also have a button named "update" that actually commits the changes made to the person to the database so that the info is not saved immediately when changing a value in a field. How can this be done?

Also the salary of the person should be a drop down list that allows me to insert a new value, and when hitting "update" the previous value will jump into the list so that I can see what salary values I have given before. How can this be done?

Thank you very much for any help you can give me!

//Sebastian Ahlman

Posted

Are these things even possible to do using FileMaker?

Just to set your mind at ease, yes, however, being the weekend, I am not sure how many people will help you given the length of the requirements above.

I recommend that you possibly rephrase your question to present a simpler scenario -- then we have to do less work to help you out, and us being lazy people (well maybe i speak for myself) will be more willing to help you out. Further, the sample file or suggestion we make will be less complex, you will have more chance of understanding how everything works and then integrating those suggestions into your solution.

Posted

Thanks!

I know it is the weekend, I just came to thinking that maybe this is not possible to do...

Well, anyhow, the first relatively simple thing I want to do is select a record in the people-table from a pop-up (It might be better to use a pop-up than a drop-down, am I right?) list on a layout. The list will contain entries with every persons first name and surname; like:

Mike Smidth

Bob Larsson

When I click Bob's entry in the list the layout switches to his record. I think this would be fairly simple to do but I still cannot figure out how to do it. (Have not used filemaker that much).

I appreciate all any help you can give me.

//Sebastian Ahlman

Posted

Here's a quick & dirty method:

1. Create a calc field Surname & " " & LastName (provided these fields are never empty; otherwise check conditional)

2. Create a textfield, set type to text, storage to global.

3. Create a relationship from People to itself; left side is your new global field, right side is the new calc field

4. Define a value list which consists of the contents of your new calc field

5. Create a layout which shows the new global on top, set to display the new value-list

6. Below, set up a portal displaying related records from the far side of your new relationship (if you only want to display one record at a time, you can forgo the portal and just display the related fields)

7. Choose an entry from the pop-up, and voila, the portal (or fields) display the values for the chosen person.

Some notes:

1. Depending on your need to control the flow of information etc., you might want to replace the popup with a portal that shows all persons (create by setting up a cartesian relationship from people to itself); then you can assign a script/button to the name and let other stuff happen. As long as FM doesn't deliver field triggers, imho a popup is inferior to a portal button.

2. A more refined methode uses global fields, which are populated and written back at the appropiate time (for this you would need the selection portal described above)

3. The relationship from working step 2 depends on the combination of surname and lastname being unique. If this isn't a given, implement a serial ID and use this to drive the relationship. You can still show the Name, but in the background the ID is used. Check the options for valuelists. (One caveat: If there are multiple persons with the same name, the value list will only show one (the first created) entry, as is actually displays the index for the field. In this case you'll have to come up with something else.)

This should get you started... ;-)

regards,

eos

Posted (edited)

Hi!

Thanks for the hints. I have steps 1 - 4 done just fine. I even tried to do the rest but whenever I click in the drop down, there is ever only one entry even though there are several in the database, and when the one is clicked I get an error message saying "This action cannot be performed because this field is not modifiable." There is no data in the fields below. Should I put any data in the global field, BTW?

As I only want to show a single record at a time I do not use any portals. When creating the relationship FM made another instance of People named People 2. I cannot seem to understand how to assign values to the drop down list. In the "Display as:"-list I choose my value list, but still there is a "Display data from:" list on the right. What does this serve? Did I not just tell the control to use the value list? What should I put here?

And when you say "far side", do you mean the right hand side of the relationship?

Sorry for being a pain in the ass. I am a seasoned developer, but I cannot seem to wrap my mind around FM.

//Sebastian Ahlman

Edited by Guest
Posted

Hi Sebastian,

check out the example I put together (it's also quick and dirty). Look at the fields, the relationship diagram, enter layout mode and see how fields are formatted, open Define Value Lists and see how these lists are defined, add new people and watch the list growing.

As for salaryHistory, I am not exactly sure what you mean...

Have fun

Oliver

PeopleExample.fp7.zip

Posted

Hi!

Can you open this and tell me why I have only one entry in my pop-up menu? I have seriously debugged this for hours, cannot seem to find the error.

:P This is getting ridiculous already...

//Sebastian

JOF.fp7.zip

Posted

Raybaudi's right - change the result type, and it works.

Very hot tip: If something doesn't work as expected, and a calc field is involved, check the result type.

Regards,

Oliver

This topic is 6368 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.