NOTE: Ignore this post - use the example as described in the OP
(this shows the "real" code - but its MUCH simpler to understand based on the example in the OP. No need to decipher this)
FYI:
I simplified the Applicability condition to this (simplified just as a test, this DOES NOT meet the requirements in the OP):
EXISTS UserEmailTemplates WHERE (UserEmailTemplates.ps_Office=LoggedInRegularUser.ps_CurrentOffice)
ERROR:
Evaluating condition EXISTS UserEmailTemplates WHERE (UserEmailTemplates.ps_Office=LoggedInRegularUser.ps_CurrentOffice)
com.bas.connectionserver.server.BASServerException: Internal error. Invalid expression EXISTS UserEmailTemplates WHERE (UserEmailTemplates.ps_Office=LoggedInRegularUser.ps_CurrentOffice)
NOTE: I know this works in a process, so I don't believe the EXISTS condition is semantically incorrect:
IF EXISTS UserEmailTemplates WHERE
(UserEmailTemplates.ps_Office = Office AND UserEmailTemplates.DRE_Type=RegularUser.TempQry1 ) THEN
FIND UserEmailTemplates WHERE
SO, I INFER
that the culprit must be the EXISTS in the Applicability condition.
Can't do this EXISTS, and can't do a COUNT