thejkfarr Posted September 17, 2011 Posted September 17, 2011 (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!
efen Posted September 17, 2011 Posted September 17, 2011 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.
thejkfarr Posted September 17, 2011 Author Posted September 17, 2011 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.
thejkfarr Posted September 17, 2011 Author Posted September 17, 2011 You can also think about this as an invoiced line item, How would one add multiple line items with a click?
randhir Posted September 24, 2011 Posted September 24, 2011 go to the relationship and checked add record in portal table
Kilyaaan Posted September 24, 2011 Posted September 24, 2011 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
thejkfarr Posted October 26, 2011 Author Posted October 26, 2011 this is beautiful, thankyou thankyou thankyou
Recommended Posts
This topic is 5076 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 accountSign in
Already have an account? Sign in here.
Sign In Now