Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

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.
#825611
You can create a trigger that fires before the Dynaform that combines the database query and the array contents:
Code: Select all
@=myGrid = array(
   "1" => array(x=>"aa", y=>"bb", z=>"cw"),
   "2" => array(x=>"ab", y=>"bg", z=>"ce"),
   "3" => array(x=>"ac", y=>"bh", z=>"ct")
);
$aRows = executeQuery("SELECT X AS x, Y AS y, Z AS z FROM TABLE_A");
$nextRowNo = count(@=mGrid) + 1;

foreach ($aRows as $aRow) {
     @=myGrid[  $nextRowNo ] = array(
            'x' => $aRow['x'],
            'y' => $aRow['y'],
            'z' => $aRow['z']
     );
    $nextRowNo++;
}
Where "myGrid" is the variable associated with the grid and its fields have the IDs "x", "y" and "z".
#826054
Sriluxshi wrote:Hi
While I am doing this I got one error that is the data is adding by one while refreshing. the nextRowNo value is increasing by one each and every refreshing. How to solve this?
Add a variable that is set the first time the trigger is executed. Then check whether that variable is set before executing the rest of the trigger:
Code: Select all
if (@@alreadyLoaded != 'yes') {
   @@alreadyLoaded = 'yes';
   @=myGrid = array(
      "1" => array(x=>"aa", y=>"bb", z=>"cw"),
      "2" => array(x=>"ab", y=>"bg", z=>"ce"),
      "3" => array(x=>"ac", y=>"bh", z=>"ct")
   );
   $aRows = executeQuery("SELECT X AS x, Y AS y, Z AS z FROM TABLE_A");
   $nextRowNo = count(@=mGrid) + 1;

   foreach ($aRows as $aRow) {
      @=myGrid[  $nextRowNo ] = array(
            'x' => $aRow['x'],
            'y' => $aRow['y'],
            'z' => $aRow['z']
       );
      $nextRowNo++;
   }
}
Task doesnt have any users.

The first problem is that you need to use = = in[…]

Just guide me to implement this?

Hi, I have a text control (rfq_segment) and I wan[…]

Genial!!! gracias. :D i need to translate an[…]