Parent Child dynamic LookUp
-
Hi Peter,
in the last couple of days I’ve been trying to replicate your Advanced LookUp filter Advanced lookups | WP Data Access , unsuccessfully.
My business case is pretty much similar to your SAS Demo:
A teacher has to record Absences / Delays for his/her Students.
Ideally, the Teacher logs on, and is presented the list of his/her Classes (group of Students), and select a student to mark him/her as Absent/Partially Present.
My dataModel is : Class (1) –>Subscription (n) –> Presence (m)
Student (1) –> Subscription (n)
I need to create a LookUp on Presence.student_id to return Students enrolled in the Class they subscripted.
What I did is:
CREATE VIEW students_enrolled AS:
SELECT subscr_id, student_id, class_id
FROM Student
INNER JOIN Subscription ON Subscription .student_id = Student.student_id
INNER JOIN Class ON Class.clas_id = Subscription.clas_id.
(used inner join to exclude class without enrolled students and viceversa, If run in SQL Query, the select works fine).
Then, I created 2 template sets:
one for Subscription, one for Absences, which includes the Relationship: LookUp (based on students_enrolled view) ON Absences.student_id to return Subscription.student_id in (P). I avoided to return class_id, by now, to check incrementally
Finally, I created a PC-ParentChild ProjectPage: Subscription (P)->Absences (C).
The LookUp returns full set of Student (not filtered by the subscription_id in Parent record selected.
In Advanced lookups | WP Data Access you mention order of lookup columns, can you please explain its importance?
Quite frustrating not being able to directly reference the subscr_id in the child record…
Thanks in advance for any contribution/help.
- The topic ‘Parent Child dynamic LookUp’ is closed to new replies.