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

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

Recommended Posts

Posted

(Beginner)--Filemaker rocks!

I have a simple time entry application, I have a portal where a manager enters employees time: emp ID 001 autoenters name and then they select time worked yada yada.

I want to be able to select a team: IE manager selects team 25 and it autoenters all the employees into the portal and then they edit times if needed.

I assume I make a button and set a script on it, but how do I make it enter multiple rows based on if an employee has been assigned to a team in the employee table?

much thanks!

Posted

What is the table in the portal that you mention - is it the employees table or another table?

Does this portal show all the employees of the particular team selected/all employees/ other selection of employees/time records/something else?

What do you require the button to do - enter the time in all rows of the portal/select the employees/create new employee time records/something else?

Please give more information on how your file is set up.

Posted

you bet:

Employee table == > Employee Lines table

My portal is setup off the Lines table pulling information from employee table. Employees are currently entered one at a time (one per row in lines)

here is my portal

{emp ID}{name}{date}{time}

Currently it is setup where the end user selects empID and the rest auto-enters

I'd like a script or some other method to add multiple empIDs at once, IE Team 25 would put in a column of 5 empIDs at once in Lines.

Posted

Hmm i made this example file, but FM Forums says that i dont have permisson to upload it.

( I have made a new topic in the FM Forums Feefback and News group, so maybe that will be fixed soon )

In the meantime perhaps you can figure somthing out from the script itself.


If [ input.seleted Team::team ID = "" // if no valid team is selected - Exit script ]

    Exit Script [ ]

End If

Go to Related Record [ From table: "input.seleted Team"; Using layout: "Team" (Team) ] [ Show only related records ]

Set Variable [ $empIDs; Value:List ( Employee::emp ID ) ]

Go to Layout [ original layout ]

#When creating records through portals - always make sure youre in the right portal -

#EVEN if you only have one portal - you never know if you someday add a second portal!!

Go to Field [ input.Employee Lines::emp ID ]

Set Variable [ $n; Value:1 ]

Set Variable [ $count; Value:WordCount ( $empIDs ) ]

Loop

    Exit Loop If [ $count < $n ]

    Go to Portal Row [ Select; Last ]

    Set Field [ input.Employee Lines::emp ID; MiddleWords ( $empIDs ; $n ; 1 ) ]

    Set Variable [ $n; Value:$n + 1 ]

End Loop

  • 1 month later...

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