You can use a query like this to limit to Report Tables from a certain number of processes:
SELECT ADD_TAB_NAME, ADD_TAB_NAME FROM ADDITIONAL_TABLES
WHERE PRO_UID IN ('2834197345a2a09e94b2ed5000427983', '33966532359aadfaeb6b2c9081082347',
'33966532359aadfaeb6b2c9081082347')
(You can find the process IDs by looking at the case information or by running cases with the debugger enabled and looking at the PROCESS system variable.)
You can create different processes to access a specific group of Report Tables and assign the users to those processes.
Another option is to make the list of processes in the SQL dependent upon the logged-in user.
Create two groups named "Reports 1" and "Reports 2" and assign users to those groups.
Then create the following trigger to look up whether the logged in user is these groups and dynamically create the list of processes:
Code: Select all//set to processes that all users can access:
@@processList = "'8511196744b6380deb57b69039061394', '33966532359aadfaeb6b2c9081082347'";
$aUsers1 = PMFGetGroupUsers( PMFGetGroupUID("Reports 1") );
foreach ($aUsers1 as $aUser) {
if (@@USER_LOGGED == $aUser['USR_UID']) {
//add processes for Reports 1 group:
@@processList .= ", '2834197345a2a09e94b2ed5000427983', '1192478525a5edc4e8910a1088175339'";
break;
}
}
$aUsers2 = PMFGetGroupUsers( PMFGetGroupUID("Reports 2") );
foreach ($aUsers2 as $aUser) {
if (@@USER_LOGGED == $aUser['USR_UID']) {
//add processes for Reports 2 group:
@@processList .= ", '1234567892834197345a2a09e94b'";
break;
}
}
Set this trigger to fire before the dynaform.
Then, add a hidden field to the dynaform whose variable and ID is "processList"
Then set the SQL query in the dropdown box to:
SELECT ADD_TAB_NAME, ADD_TAB_NAME FROM ADDITIONAL_TABLES WHERE PRO_UID IN (@#processList)