Pre-filter on related data doesn't work

sonolento

New Member
Hi,

This is my current problem:
Is this system:
- Teachers can create a course.
- Teachers or non registered users can inscribe in a course, sending their cell phone number and name.
- Users can see how many inscriptions they've got and the cell phone numbers.

Table A:
Tableid - Auto field
Course - Text field
Location - Text field
TeacherUserid - User automatic field

Table B:
TeacherUserid - Dropdown Databasejoin with userid from Table A
Name - Text field
Cell phone - Text field

Listing Table B pre-filtered by current userid

Everything works well, using the form from table B. The dropdown shows the users from table A.
When a registered user logs in, he only sees the results with his userid.

The problem starts when one uses the related data function on table A.
So that the table B (after clicking on the link on the form from table A) shows automatically up the id of the correct teacher, the settings have to be like in the "related data tutorial":
Value = Tableid
Label = Teacheruserid

But like this, when a teacher looks up how many colleagues inscribed for his course, the message "no results" shows up.
Without the pre-filter, the listing shows the teacher's ids.

What's wrong?
Should the settings be different in the dropdown? Is both value and label are set to Teacheruserid, the result is even worse. The Teacheruserid field becomes blank, even after manually selecting the teacher id.
Is the problem in the pre-filter?
 
Tried a new approach.
To copy the dropdownjoin label to a new field.

I can the value with this code:
$useridcopy = '{contactis___User_idperm_raw}';
return $useridcopy;

But I dont get the label with this code:
$useridcopy = '{contactis___User_idperm}';
return $useridcopy;

How can the label from the dropdown join be copied to another field (as value)?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top