I see that your script is using the Perform Find [ Restore ] script step.
Geneally I advise to NEVER use that option.
I suggest that you use a method I call explicit scripted finds.
It goes like this:
Enter find mode
Set field [ someField; someValue ]
The advantage of this method is that you can immediately see what the script is doing just by looking at the script.
Since you are using a checkbox field, then it is important to recognize that a checkbox field is just a text field, and what it really contains is the checked values separated by returns.
So if the user had checked Health Fair and Registration and PTA, then the contents of the field are as follows:
However, the order of the items isn't necessarily the same as the value list, so the contents might actually be:
Your find script will need to enter find mode; loop through the checked items, creating a new request for each item, then perform the find.
Check the first layout in your script. It does not seem to be based on any TO. Also, the two layouts will need to be based on the same TO for a simple layout-switch to present users with the found set; otherwise you will need a GTRR (go to related record) script step or the like.
Does that help?
Here, here, Bruce. I fully concur with not using the "Perform Find [RESTORE]" because you can't tell by looking at the script what it is doing. I'm at a bit of a loss to analyze this script without being given a copy of it because I can't look in the Perform Find steps to see what is being searched on.
I'm quite confident you are searching for things in a related table and the search hasn't taken into account the type of relationship (one-to-one, one-to-many) and what happens if there is no related record in a relationship.
If you'll rewrite the script like Bruce suggests and then give us a snap shot of the relationship graph, I'm sure we'll figure it out for you.
Thank you, Bruce! The example does exactly what I look for. Unfortunately, the search condition doesn't pass to the Perform Find function. Hopefully, I can explain this in more details.
Each school has a value list for activities. All volunteer have a text field for the selected activity for each school. The relationship between the tables are: volunteer_data table contains all the information related to the volunteer (including the vol_interest_AMS_activities text field), volunteer_data_inout table contains the login and logout time, AMSactivities_data table is similar to your meeting table
Here is the screenshot as we running through the script:
It seems like nothing was passed into the Perform Find() function because the script returns all volunteers as the result (error 103: missing relationship). How do we watch the value of the Perform Find() function?
Any further advice is really appreciated.
Why is there a go to related record statement? It doesn't belong there.
Also: when debugging the script, stop on the peform find command. You will still be in Find Mode.
Then the screen should show you what values it has placed in the fields in find mode.
We tested around and forgot to comment out the code. It is now
Therefore it is now working correctly?
Remove that and also correct the Set Field code right above it. We compared the wrong variables. It is working now!
Thank you very much, Bruce!!!