Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By Palele
#813408
Hello
Is it possible to change this #field
forum processmaker.JPG
forum processmaker.JPG (119.98 KiB) Viewed 2399 times
I try to modify file casesList.js but if I return something else all fields were changed
Code: Select all
        var columnRenderer = function(data, metadata, record, rowIndex,columnIndex, store) {
        var new_text = metadata.style.split(';');
        var style = '';
        if ( !record.data['DEL_INIT_DATE'] ){
            style = style + "font-weight: bold; ";
        }
        for (var i = 0; i < new_text.length -1 ; i++) {
            var chain = new_text[i] +";";
            if (chain.indexOf('width') == -1) {
                style = style + chain;
            }
        }
		
		//var cos = record.data['APP_TITLE'];
        //metadata.attr = 'ext:qtip="' + cos + '" style="'+ style +' white-space: normal; "';
		// return cos;
		
        data = Ext.util.Format.htmlEncode(data);
		metadata.attr = 'ext:qtip="' + data + '" style="'+ style +' white-space: normal; "';
		return data;
	  
    };
forum processmaker 2.JPG
forum processmaker 2.JPG (90.63 KiB) Viewed 2399 times
I think the most important line is that but where to look further?
Code: Select all
 data = Ext.util.Format.htmlEncode(data);
Sorry for my english. Thanks for any help.
User avatar
By amosbatto
#813423
One option is to use Custom Case List Builder in the Enterprise Edition to add an additional column to the case list.

You can change the value of the Case's title from "#67" to any value either by setting the Case Label in the Task Properties or by writing directly to the APPLICATION.APP_TITLE and APP_CACHE_VIEW.APP_TITLE fields in the database.

Here you are trying to change the case number, which is stored in the APPLICATION.APP_NUMBER and APP_CACHE_VIEW.APP_NUMBER in the database. You can either write an integer to these fields or write to APP_SEQUENCE.ID field in the database. The next case which is created will have a case number of APP_SEQUENCE.ID + 1.

If you want to replace the case number with another value, then you need to modify the Applications::getAll() function defined in workflow/engine/classes/class.applications.php.
I created a REST endpoint which has some documentation which will help understand what this function does in PM:
viewtopic.php?f=44&t=730200&p=813110#p813110

You need a PM Table named "ALT_CASE_INFO" with fields like this:
char(32) APP_UID,
vchar(256) REPLACE_CASE_NUM

"PMT_" will automatically be prepended to the table's name. APP_UID is the case ID. You need to add triggers to the start of each process to automatically insert a new row in this table with the case ID in the APP_UID field and the alternative case number in the REPLACE_CASE_NUM field.

Then, you need to add this line at the top of the getAll() function:
Code: Select all
G::LoadClass("pmFunctions"); 
At the bottom of the getAll() function, change the code from:
Code: Select all
        $result['data'] = $rows;

        return $result;
    }
 
To:
Code: Select all
        foreach ($rows as $key=>$row) {
            $sql = "SELECT REPLACE_CASE_NUM FROM PMT_ALT_CASE_INFO WHERE APP_UID='".$row['APP_UID']."'";
            $aAltInfo = executeQuery($sql);
            if (is_array($aAltInfo) and count($aAltInfo)) {
                $rows[$key]['APP_NUMBER'] = aAltInfo[1]['REPLACE_CASE_NUM'];
            }
        }    
        $result['data'] = $rows;

        return $result;
    }
 
I haven't tried this code, so it might require some editing, but this is the basic idea how to replace the APP_NUMBER with your own custom value.
By Palele
#813489
Thanks. It works perfectly
But you missed $
$rows[$key]['APP_NUMBER'] = $aAltInfo[1]['REPLACE_CASE_NUM']
Thank You.

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]