- Thu Mar 10, 2022 10:10 pm
#829784
https://wiki.processmaker.com/3.1/Grid_Control#Populating_Grids_with_a_Database_Query
This online menu could help you for populating grids with a trigger to query a DB, put query results into a grid.
1/ Not in a real time event: //easy solution
Yes, trigger is designed to run either before loading a dynaform or after submitting a dynaform.
Logic:
-- Before a dynaform, run your trigger to get query from DB save up to the grid table
--Based on your checkbox or radio option, hide/show the a particular grid rows (since you already have data on hands)
2/if you want a real time to an event when a button or a checkbox checked, your event sequence could be:
When a checkbox checked (setOnchange()) > simulate a form submit action > run a trigger (after dynaform) >
Logice of your trigger: //advance solution
- do a query based on your value of checkbox or dropdown whatever
- query results directly assigned to a grid (same fields vs. grid's column fields)
- last php statement to jump back to presvious step i.e. returning to your presvious task but the form/grid get filled