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

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

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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

Posted

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.

Posted

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. :)

Posted

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.. : )
Posted

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?

Posted

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:"" ]

Posted

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:

This topic is 4659 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.