That looks like you are using the wrong TO. StudentsAll would appear to be a cartesian relationship. Try using a relationship that is single record focussed.
not IsEmpty( (StudentsAll::teacherName))
instead of IsValid.
Thanks for a very fast reply!
The cartesian relationship is there as I would like the students to be related to the teacher after the tests is created.
So a teacher has a dasboard where the teachers sees all students in a portal (Cartesian). The teachers clicks a "test create" button with a script that creates the test (a related set of records with FK for both teacher and student) for the particular student.
If another teacher views the same portal it is obvious that this student/test is already created and related to another teacher.
Does this make sense?
Yes it does, but if you then use that relationship in your conditional formatting it will affect all records. You don't need to change the whole portal, just the CF formula.
I tried to change the CF formula from:
not IsEmpty (studentsAll::TecherName)
not IsEmpty (Student::TeacherName)
I still get a change of conditions for all rows in the portal?
If you have two relationships where
• one is Cartesian to a main entity (for a picker portal) and
• the other is a join table by keys (usually displaying the result of something you did with a picker selection)
and you want to highlight the fact that a given Cartesian row has already been selected, the generic format is
not IsEmpty ( FilterValues ( Cartesian::id ; List ( Join::foreignIDOfCartesianParent ) )
Read: the primary key of a given Cartesian row appears in the related join table list of foreign keys for that entity,
or in plain English: That student has already been assigned to that related set.
ABSOLUTELY fantastic. Thank you very much. Works brilliantly!
Thanks erolst. That's pretty much the point I was driving at, but so much better described than my shorthand version.
Thank you very much.
As you can tell I´m very new to Filemaker and I'm amazed by the level of skill and helpfullness you all offer!!!
Sorry, but another another thing just popped up.....
What if a student have multiple multiple buttons in a portal row. Each button runs a script creating a test. How can the button be formatted to change color if a particular test is created. I have worked this problem for quite some time, but my problem is that all button for creation of the test change formatting when one is tapped.
I suspect it is a matter of setting up an "AND condition but I can't get this to work.
Another take to this problem could be:
1) Over the portal you have a global field formatted as dropdown list with all the possible tests.
2) you filter the trivial portal on that global, showing only the students that did not yet take the chosen test.
3) You still have only one button, which sets the student as having taken that test and refreshes the portal.
Thank you again..... I will try out that approach. ;-)
Hmmmm, I have struck a problem... The tests are not static, but created via a script:
Set Variable $StudentID ; Value Students::_PKStudentID
Go to Layout “test” (Test)
Enter Find Mode
Set Field Test::_PKTestID Globals::gTestID
Set Variable $QuestionIDList ; Value: List (Questions::_PKQuestionID)
Go to Layout “Answers” (Answers)
Enter Find Mode
Set Field Answers::_FKStudentID ; -1
Set Error Capture On
Set Variable $K: $K + 1
Exit Loop if $K > Valuecount ( $QuestionIDList )
Set Field Answers::Testactivity ; Globals:: gTestID
Set Field Answers::_FKStudentID ; $StudentID
Set Field Answers:: Get Value ( $QuestionIDList ; $K )
Set Field Answers::_FKTeacherID ; Globals::gTeacherID
The script is slightly modified from this, but this is the original idea/concept...
So a test does not have a static key value but consist of a number of response records given a name, tied to a student and a teacher. I can't get my head round filtering the portal you suggest from here?