thanks for your attention, i have some change on your trigger that you mention in (
viewtopic.php?f=41&t=710430&p=790694#p790694) post and put it before second dynaform in paralell tasks such as human transport costs but my problem being after download the csv file generated. for example when i download the file generate after human transport cost and approve end process in next step and go to equipment costs task i see all field in this dynaform have been null.
this my trigger before second dynaform in parallel tasks:
Code: Select all@@csvFilename = '';
@@csvLink = '';
if (isset(@=ptransport) and is_array(@=ptransport) and count(@=ptransport)) {
$aCsv = array();
//set the first row in the CSV file to the IDs of the grid fields
$aColumnHeaders = array_keys(@=ptransport[1]);
$line = '';
foreach ($aColumnHeaders as $fieldId) {
$line .= (empty($line) ? '' : ';') . $fieldId;
}
$aCsv[] = $line;
//set each data row in CSV file:
foreach (@=ptransport as $aRow) {
$line = '';
foreach ($aColumnHeaders as $fieldId) {
$val = $aRow[$fieldId];
if (is_array($val) or is_object($val)) {
$val = json_encode($val);
}
//sanitize CSV data to handle double quotation marks, commas, semicolons,
//spaces and new lines
$val = str_replace('"', '""', $val);
if (preg_match('/[,;"\n\r]/', $val) or trim($val) != $val) {
$val = '"' . $val . '"';
}
$line .= (empty($line) ? '' : ';') . $val;
}
$aCsv[] = $line;
}
//create a temporary output file:
$path = tempnam(sys_get_temp_dir(), "transport_") . ".csv";
file_put_contents($path, implode("\n", $aCsv));
$inpDocId = '1218872075b4ad7451ca8d9021570171'; //set to ID of the Input Document
//upload temp CSV file to PM:
@@fileId = PMFAddInputDocument($inpDocId, null, 1, 'INPUT', 'CSV file of products',
'add', @@APPLICATION, @%INDEX, @@TASK, @@USER_LOGGED, 'file', $path);
unlink($filename); //delete temporary CSV file
if (empty(@@fileId)) {
$g = new G();
$g->SendMessageText("Unable to upload CSV file to current case.", "ERROR");
}
else {
@@csvLink = (G::is_https() ? 'https://' : 'http://') .
$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].'/sys' .
@@SYS_SYS.'/en/neoclassic/cases/cases_ShowDocument?a='.@@fileId;
@@csvFilename = pathinfo($path, PATHINFO_BASENAME);
}
}