The information in this article applies to:
Product: Metastorm BPM (e-Work)
Version: 6.6.x 7
Issue
- A dynamic role that uses %SelectSQL to return a list of users is failing if there is more than 1 user in the list.
Resolution
For successful evaluation, a dynamic role requires a comma-separated list of users. The default row separator used by %SelectSQL is a new line (carriage return/linefeed combination). If only 1 row (1 user) is returned, this is not a problem. If more than 1 row is returned, the role will not be properly evaluated. The simplest resolution is to use %GetData, whose default row separator is a comma. An alternative is to use %SelectSQL but to specify a comma as the row separator.
FAILS (unless there is only 1 user in the eUser table):
%SelectSQL("SELECT eUser.eUserName FROM eUser WHERE (eUser.eUserName IS NOT NULL) ")
SUCCEEDS:
%GetData(,eUser," (eUserName IS NOT NULL) ","eUserName")
%SelectSQL("SELECT eUser.eUserName FROM eUser WHERE (eUser.eUserName IS NOT NULL) ","","",",")