The method of filtering a multi-select field is very similar to dynamically filtering single-select dropdowns as described here. However, the problem with filtering a multiselect is that when you edit the record the filtered list is not shown and all the checkbox options given in edit mode are listed instead. Filtering it again causes the selected options for the record to be lost. The workaround is to add a script in the on Edit>on Load task that saves the selected options, filters the list and sets the selection back again.
1. Create the multiselect with dummy options, note that when selections are saved in the field those options will be saved automatically
2. Setup dynamic filtering in the same way as for dropdown fields
3. In the on Add>on Edit action of the form write the following code:
//first save the checked options in the Course field
x = List();
for each opt in input.Courses
{
x.add(opt);
}
//clear it and filter it so that it shows the correct courses for the selected School
clear Courses;
rec = CourseForm [Criteria == input.School];
Courses:ui.add(rec.Courses.getall());
//set the previously selected options again
for each y in x
{
Courses.select(y);
}