Page_load event on click

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mpol_ch
User
Posts: 877
Location: Switzerland

Page_load event on click

Post by mpol_ch »

Hi,

I need an button on list page to click for sync a table.
Is there an example to have a look into?

I should not select any row to carry out the action...
Onclick it should run the sql query...

  function Page_Load() {
    $this->CustomActions["syncdata"] = new ListAction("syncdata", "<b><font color='green'> Sync Data</font></b>"); // Create custom action

$action = Get("action"); // Get the value of the "action" parameter

   if ($action == "syncdata") { // Check if the action name is "monatsimport"
  $myField = ExecuteStatement("REPLACE INTO Scoredtab SELECT * FROM ScorredSupplier_View"); // Run the SQL command to replace records in Scoredtab with the result of SELECT query
   }
}

mpol_ch


arbei
User
Posts: 9384

Post by arbei »

You may read Page_Load -> Example 3 in docs and update your code accordingly.


Post Reply