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.
#825416
Hi Amos,

Thank you for your assistance. Grids are really, really challenging for me on ProcessMaker. May I please request your help with the following?

1) The attached Quotes.json form generates a grid of 3 rows for every item that requires a quote in the first form. I'd like to make sure the user only check one checkbox for each 3 rows. (please see trigger at the end)

2) Highlight every 3 rows alternatively so that it is easy for users to see

3) Attach only selected quotes in the email to the next assigned user

Thank you.
Code: Select all
$gridID = @=techEquipment;
@=gridQuotes = '';
$num = 1;


// Filter array

    function filter_by_value ($array, $index, $value){ 
        if(is_array($array) && count($array)>0)  
        { 
            foreach(array_keys($array) as $key){ 
                $temp[$key] = $array[$key][$index]; 
                 
                if ($temp[$key] == $value){ 
                    $newarray[$key] = $array[$key]; 
                } 
            } 
          } 
      return $newarray; 
    } 

$results = filter_by_value($gridID, 'needQuote', 'Y');
@@countQuotes = count($results);

if (isset($results) and !empty($results) and $results != '[]') {
	foreach (range(1, 3) as $i) {
		foreach ($results as $key => $result) {
			@=gridQuotes[$num] = array(
				'reference'	=> $key,
	        	'optionsQuote' => $result['equipmentType_label'] . '/' . $result['options_label'] . '/' . $result['comment_label']
	    	);
		$num++;
		@=gridQuotes = orderGrid(@=gridQuotes, 'reference', 'ASC');
		}
	}

} else {
};

Attachments
(7.56 KiB) Downloaded 222 times
#825443
amosbatto wrote: Mon Jul 15, 2019 11:15 pm
PipSqueak wrote: Mon Jul 15, 2019 5:03 am 3) Attach only selected quotes in the email to the next assigned user
What is your question 3? How to find the next assigned user? how to filter the grid? how to send the email?
Sorry for the confusion, all 3 questions are separate issues.

As for no.3, I know how to attach input documents in email, but I do not know how to attach only the "Selected" quotes on the email to the next assigned user.
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]