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

Filtering Portal to Current Week Only


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

Recommended Posts

Posted

Hello All,

I am a newbie with FileMaker Dev (about 1 month) and making progress fast thanks to this forum.

I'm stuck on a problem though, and hoping you guys can help.

I am developing a Timecards module for our company. Basically a user records time against various job weekly. I created an entry form with the various fields to fill in at the top, and at the bottom of the form I have a portal. The purpose of the portal is to show time entries for the current user for the current week only with a total hours field.

The portal is using a self relationship, back to the same file relating the username. I am stumped on how to make fields, and set up a relationship that would cause the portal to filter on the current week only.

Is this even possible? Does anyone have any suggestions on how to proceed? I can provide more detail upon request.

Thank you.

Posted

Hi,

FM provides a calc based on Week. Week(your date field) return the week number.

You could start with this or give us more details about the structure...

Posted

Hello again and thanks for the reply. The list of fields for the TimeCard file are attached as a text file.

Here is my latest attempt:

The data Entry form collects data in global fields, then when the users presses a Save Entry button, I run a script to create a new record, and copy all the global fields to the current record.

The goal is to have the portal display records for the current user (identified by gUserId or gStaffId) for ONLY the current week, with a total of that time in hours. I am trying to have the user enter data related to a time entry (job number, jobname, etc) at the top half of the form, then as he/she clicks the Save Entry button, the portal on the bottom half of the form will show entries for the current week with a total.

The relationship I am trying is a self relation ship where the left side is:

gUserAndWeek (concat gUserId with Week of Year, i.e. jsmith15)

and the right side would be:

UserAndWeek (stored value of the same which is added by script)

When I try to make the relationship, FM 6.0 gives a error that the relationship will not work because gUserAndWeek cannot be indexed.

I hope this provides more information. Does anyone have any ideas on a way to make this work?

Thank you.

Timecards.txt

Posted

Your correct! I just blindly heeded the warning, and never tried it. It appears to work!

I am going to do some more testing now. I may have solved my own problem.

Thank you very much.

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