February 19, 201213 yr Hello everyone; Attached i have a file, but what is bugging me is wonky behavior in table / form view, IN list view it works fine as far as i can tell. It is a very simple file, but i really am confused here. ANy help / direction would be great. emp.fp7.zip
February 19, 201213 yr is wonky behavior in table / form view In what way, Ian? What are you pointing to? If you mean the portal on the Time layout, then that display is correct (in form view) because it is displaying the Parent. If in table, portals don't work at all.
February 19, 201213 yr Author In what way, Ian? What are you pointing to? If you mean the portal on the Time layout, then that display is correct (in form view) because it is displaying the Parent. If in table, portals don't work at all. OH Ok Portals don't work in table view is what you are saying.. Thanks
February 19, 201213 yr Author What is happening Is in Employee Table, records are being created when i choose the drop down menu for employeeID Other issue is in Time Copy Layout, when you choose an Employee ID, all the records become populated. Perhaps i am designing the relationship incorrectly! 1 employee can work many hours so 1 to many , but i think i need to create a groupID for the work week in essence in order to group the data together for keeping everything in order. Am i incorrect in my thinking here? What bothers me or what i can't understand is it seems to work "Perfectly" in list view. If i find out what is going on i will post more. -i
February 19, 201213 yr It makes no sense to have a portal of employees on your time layout. Your relationship is correct ... you have multiple time records for one employee. Where are you firing the script? You set the first variable from Time. But a time record should be started on employee, setting the EmployeeID with Employees::EmployeeID. Always consider your perspective ... what is the table occurrence of the layout you are standing on when the script is fired? i think i need to create a groupID for the work week in essence in order to group the data together I don't see why. Work-week dates are automatically available to any calculation or script via date functions.
February 19, 201213 yr I guess it's fine to be on time record to get the EmployeeID if that is what you are intending. I just do not see why you have the multi-row portal to employees on Time. And yes, 'all the records become populated' because you are looking at a portal of the parent. It doesn't populate many parents - it only looks that way. You have Time fields inside that Emp portal. As I said, perspective is everything in FileMaker. :)
February 19, 201213 yr Author It makes no sense to have a portal of employees on your time layout. Your relationship is correct ... you have multiple time records for one employee. Where are you firing the script? You set the first variable from Time. But a time record should be started on employee, setting the EmployeeID with Employees::EmployeeID. Always consider your perspective ... what is the table occurrence of the layout you are standing on when the script is fired? I don't see why. Work-week dates are automatically available to any calculation or script via date functions. I agree . no sense , but what other choice do i have exept a self relationship or 1 table only. So what you are saying is to go to the employee layout and create a new time record for the employee. SO i need to add a field on Employee for timeRecordID then. -i I guess it's fine to be on time record to get the EmployeeID if that is what you are intending. I just do not see why you have the multi-row portal to employees on Time. And yes, 'all the records become populated' because you are looking at a portal of the parent. It doesn't populate many parents - it only looks that way. You have Time fields inside that Emp portal. As I said, perspective is everything in FileMaker. It is still a learning experience as i am sure you know.. : )
February 19, 201213 yr Please describe exactly what you are trying to do. "but what other choice do i have exept a self relationship or 1 table only." Why? What are you trying to do that does not work? YOur relationship is correct. SO i need to add a field on Employee for timeRecordID then. No. You do not put a TimeID in the Employee table - 'time' is the many side. The many side always holds the parent's key and not the other way around. You still have not described what you are trying to do?
February 19, 201213 yr Author I will take a break LaRetta. Will stop tonight. Sometimes you have to take a break. thanks for helping me ok. -i
February 20, 201213 yr Author Ok, this is what i did to get my desired behavior via portal Added 1 more TO of time with a new field = field - added that portal to new Layout with Time as Context; User chooses Employee from drop down menu and then after adds new entry via script #set $id variable If $$recordID = Time::Field then on same record Set Variable [ $id; Value:Time::empID ] If [ $$recordID = Time::Field ] Set Variable [ $$recordID; Value:Time::Field ] Else Set Variable [ $$recordID; Value:Get(RecordID) ] End If #Stop flashing in windows Freeze Window Go to Layout [ “Time” (Time) ] New Record/Request #Set both fields as we are on similar record Set Field [ Time::empID; $id ] Set Field [ Time::Field; $$recordID ] Commit Records/Requests [ Skip data entry validation; No dialog ] Go to Layout [ original layout ] Go to Field [ Time::startTime ] [ Select/perform ] #Clear $$recordID Set Variable [ $$recordID; Value:"" ]
February 20, 201213 yr Well, since you did not explain what you are attempting to do, I would say that this script does exactly what you explained you needed. :laugh2:
Create an account or sign in to comment