This topic is locked

Add multiple child records based on multi-select Lookup Wizard

10/4/2019 10:45:19 AM
PHPRunner General questions
D
druck281 author

Working on an application that tracks training for our employees. Each time I add a training session, I want to be provided a list of employees to assign to that session. I assume using the Lookup wizard with check boxes and allowing multi-select is where I need to start. Do I just need to write all of the selected items into an array then use an "INSERT INTO" sql statement to get them into the database? Can I trigger this whole process with a button (or link) on the Session page? It would be great to have an icon next to the "Edit" icon for each session to allow the user to assign employees. Am I at least on the right track in my thought process?

D
druck281 author 10/4/2019

DERP...So I did a little more digging and found this article...
https://xlinesoft.com/phprunner/docs/select_multiple_values.htm
I changed the field on the Session_Attendance_Add page to the lookup Check Box field and added the code per the article. It is erroring out before it adds the records showing "<<< Record was NOT added >>>
Column 'Staff_ID' cannot be null"