You're not doing anything wrong. That's just how pop-up menus and drop-down lists work with two-field value lists. Pop-up menus show the selected value from the second field (meanwhile the value contained in the field is actually the first field from the value list); and drop-down lists always display the actual contents of the field (the first field from the value list), even if you only show the second field in the value list.
I have a button (pop-up menu as the control style) and the Inspector "Display data from" is set as the Employee::FullName.
I believe that Jeremy has your issue identified but I noticed the part I bolded ... that would not be correct. It should be set to display the EmployeeID field from the table you are setting with the ID.
What is happening is that when I select a employee from the pop-up menu button it's trying to update the employee that first is shown when we load the page it's employeeid with the one you selected. Anybody know why? I have here is a visual of my layout. So basically I have the upper left button the pop-up menu
You're actually working with the primary key field of that record! What is supposed to happen when you select an employee from the pop-up menu? Navigation to another record? Filtering of related records? Whatever it is, you should create a global field for that purpose and format that one with the Employees value list.
When you select an employee from the pop-up menu I want to populate the portal in the white and gray lines with it's employees work orders. Also, display it's employeeid and employee full name that you selected. Also, you have 2 dates "FROM" and "TO" date ranges you would be able to select to show only those work orders from the date ranges. Hope that makes sense. Thanks.
In fact, it does. So these work orders come from a related table, and the relationship is set to filter on date range and an employee ID. That still means that you should either define a global field for the ID to see any employee regardless of the context (employee record) you're presently on; or use the primary key of the Employee table in the relationship and navigate to the desired employee, where you'd only have to set the date range (since the employeeID is an attribute of the current record).
Hope that makes sense. This might be less confusing (to you) if you'd create a utility table specially for such queries and define the relationship from there. Anyway, don't touch the primary key. You can use it in relationships, or create a value list from it and use that with other fields, but it's best to not even display the key field on the layout, lest things like these happen.
The field where you are selecting the ID must be, as explained, NOT the Employee::EmployeeFullName and NOT the Employee::EmployeeID.
It should be a different field probably a global field. If you attach the pop-up to the global then Users can select an Employee and enter their dates (also into global date fields).
Without knowing how you are set up, jp10, it is impossible to provide further information on how you should establish your relationship. We do not even know the name of the current layout's table and we need that information. Neither do we know what the dates represent and we need to know that also. I would assume that the Employee table does not hold those dates and we have another table involved.
Again ... we need to know the purpose and context here ... what is the name of the base table we are viewing, what is the portal name and what is that relationship based upon and what kind of records are you trying to find? Once we understand what you are trying to accomplish, we can walk you through achieving those results.
Thanks for the feedback. Ok gotcha I thought for some reason you said to add the EmployeeID for the pop-up. I think I got what your trying to say is that basically the pop-up button and 2 date buttons need to be global. I will give that a try.
Here is a little more context you requested. The 2 tables involved here are Employee and EmployeeWorkOrder they are both related by EmployeeID. The portal is displaying data from the EmployeeWorkOrder table. The 2 date buttons are global fields and exists in the Employee table. Basically, I want to be able to select and EmployeeName from the pop-up menu then display that Employee full name and show his/her work order for the specific date range specified. I have attached above an image of the layout of what I am talking about (second attached image from above). The work order portal will display fields like date, work order type (like filter change, new install etc.), status of work order, location and zip code. Basically, want to display the technicians work schedule for the days we select.
Hope that makes things more clearer. Appreciate the help.
Thank you for the additional information. Then I would suggest this approach:
Leave your existing portal alone - which shows ALL of the work orders for the current Employee record and it should be working fine, with the portal changing work orders depending upon which employee record is being viewed at the given moment. Your existing relationship should be:
Employees::EmployeeID = EmployeeWorkOrders::EmployeeID
Create a new table occurrence of EmployeeWorkOrders maybe called Selected Work Orders and join to Employee table thus:
Employees::gEmployeeID = SelectedWorkOrders::EmployeeID
Employees::gDateFrom <= SelectedWorkOrders::Date
Employees::gDateTo >= SelectedWorkOrders::Date
Attach your pop-up Employee to gEmployeeID. Now when you select an employee and both dates, the portal based upon this new relationship will fill in. Be sure to specify the portal and its fields to this new SelectedWorkOrders table occurrence.
As Erolst points out, this functionality could be placed in any table but since you are putting it in Employees, be sure the layout being used does not display other employee fields. It should be made to look like a generic Menu. User should only see the name from the Selected Employee field (as you said) - seeing other employee data would be confusing.
Also, you can set those global dates to pre-fill if empty (using auto-enter replace) so ALL work orders display but I suggest the opposite ... leave the portal empty until both dates and EmployeeID is entered. If you have further questions, please ask. We are all here to help.
Thanks LaRetta appreciate the information. I think I need to take a step back I get the over all big picture of what needs to get done, but I think I need to take it step by step. I'm getting confused my apologies. =)
Please I need help on how to just do the basics and get the pop-up menu to display the employee names. Then based on the employee name selection just dump that employees work orders in a portal. As much details as possible would be great. I created the pop-up menu it shows the employees names then I created a portal and selected the fields I wanted to display from the work order, but when I select employee name nothing happens no records are being dumped into the portal. I created a relationship from employee table to work order table by employeeid too. Am I missing a script? Appreciate it.
I did present it step by step.
Can you just begin following the suggestion then post specifically where you get stuck? You can ask me sentence by sentence as you try to do it ... I will work with you.
I cannot even present a demo file since I am currently away from office on ipad only. Someone else will have to assist otherwise.
I know LaRetta you have done a fantastic step by step explaination and I really I appreciate it very very much. My piece that I'm stuck on is when you said "keep your existing portal alone where it shows all the employees work orders". I got the pop-up button to show the employees and I created a new portal with fields from the work order table and built a relationship with employee table and work order table joined on employeeid. I selected couple of fields from the work order table for the portal as well. I select a employee and nothing happens to the portal no data is displayed.
Appreciate the help.
Just wanted to thank you again for all your help. Erolst basically wrote the layout for me from what you posted. I can't thank you guys enough!