I have read pages of posts and watched all the relevant V10 and 11 vids - so far without resolution. My challenge: I have two related tables - one containing 'Teacher' details and one 'Schools.' The SchoolID primary key is related to SchoolID in the Teachers table. When recording a teacher as being at a particular School (in the teacher details grid), I want the user to have a filtered list of schools to select from. I also the school name to be displayed and the SchoolID to be stored (in the Teacher table). Sounds simple so far.
I've chosen to filter the Schools using the 'Variable, OnGridInitialise rtc and Function' format that is so well explained in the TT videos. The ListSchools() is set out below - where Cluster is the school selection criteria.
FUNCTION ListSchools AS C ( )
cn="::name::CMS"
table="Schools"
filter="ClusterID= " +session.ClusterID
result="SchoolName"
ListSchools = sql_get_values(cn, table, filter, result)
END FUNCTION
This combination produces a list of the school names as I want them in the 'Interactive' window - so I know the Function 'works.' However, when I proceed to select a school name from the dropdown box the response returns a conflict error. This seems to me to be because the Function selects and tries to store a name (as it is 'asked to,') rather than storing the ID. I note that for a 'static' list to display and store seperate values they are separated by a 'bang.'
I'm using a grid (rather than a dialogue) and a TabbedUI rather than A5w pages.
Some posts refer to 'other' ways of filtering dropdowns, but I can't find them. Can anyone point me in the right direction?
I've chosen to filter the Schools using the 'Variable, OnGridInitialise rtc and Function' format that is so well explained in the TT videos. The ListSchools() is set out below - where Cluster is the school selection criteria.
FUNCTION ListSchools AS C ( )
cn="::name::CMS"
table="Schools"
filter="ClusterID= " +session.ClusterID
result="SchoolName"
ListSchools = sql_get_values(cn, table, filter, result)
END FUNCTION
This combination produces a list of the school names as I want them in the 'Interactive' window - so I know the Function 'works.' However, when I proceed to select a school name from the dropdown box the response returns a conflict error. This seems to me to be because the Function selects and tries to store a name (as it is 'asked to,') rather than storing the ID. I note that for a 'static' list to display and store seperate values they are separated by a 'bang.'
I'm using a grid (rather than a dialogue) and a TabbedUI rather than A5w pages.
Some posts refer to 'other' ways of filtering dropdowns, but I can't find them. Can anyone point me in the right direction?
Comment