Questions and discussion about using ProcessMaker: user interface, running cases & functionality

Moderator: amosbatto

By FreddyBernal
#826228
Hi,
How can display a grid with all cases that have a value in a variable (for example: variable City='XXX'), showing the last step (or a state).
Also, I can generate a link to the summary of these cases?

Regards and tks.
User avatar
By amosbatto
#826258
You need to create a Report Table and export the variable that you want to use to the Report Table.

Then, write a trigger that finds all the cases in that report table meeting you criteria and join that to the APP_CACHE_VIEW table like this:
Code: Select all
//change to the value you are searching for:
$valueToFind = addslashes('some value');
$sql = "SELECT RT.APP_UID, RT.APP_NUMBER, MAX(ACV.DEL_INDEX) AS MAX_INDEX 
    FROM MY_REPORT_TABLE AS RT 
    LEFT OUTER JOIN APP_CACHE_VIEW AS ACV ON RT.APP_UID=ACV.APP_UID 
    GROUP BY ACV.APP_UID
    WHERE RT.MY_FIELD='$valueToFind'";
$aCases = executeQuery($sql);

$baseUrl = ($g->is_https() ? 'https://': 'http://') . $_SERVER['HTTP_HOST'] .
   '/sys' . @@SYS_SYS .'/'. @@SYS_LANG .'/'. @@SYS_SKIN . '/cases/opencase/';
@=casesGrid = [];
$cnt = 0;

foreach ($aCases as $aCase) {
    $cnt++;
    @=casesGrid[ $cnt ] = [
           'caseNumber' => $aCase['APP_NUMBER'],
           'caseLink' => $baseUrl . $aCase['APP_UID']
    ];
}
Then create a grid which is associated with the variable "casesGrid". This grid should have a textbox with the ID "caseNumber" and a link field with the ID "caseLink".

Set the above trigger to fire before the Dynaform holding the grid.
User avatar
By amosbatto
#826495
FreddyBernal wrote:How can i do this: "You need to create a Report Table and export the variable that you want to use to the Report Table. "?
Presumably you have a variable named "City" in your process. Create a Report Table and add City to the list of variables in the Report Table.

Note that City has to be in your list of variables in the Process designer to be exported to a Report Table. It can't be a variable that was created with a trigger.

Capture.PNG I have use this javascript code to ad[…]

Having a business, especially when it involves tra[…]

The condition is not workable

Hi there, Recently I've encountered the amount wh[…]

Yes i'm using vue js to load the data.