September 17, 201114 yr (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!
September 17, 201114 yr 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.
September 17, 201114 yr Author 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.
September 17, 201114 yr Author You can also think about this as an invoiced line item, How would one add multiple line items with a click?
September 24, 201114 yr 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
Create an account or sign in to comment