Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Filtering Portal to Current Week Only

Featured Replies

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.

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

  • Author

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

Hi,

because gUserAndWeek cannot be indexed.

But it's at left side !!! So it doesn't matter. The right side must be indexed...

Ok, I'll look to the files.

  • Author

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.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.