|
To update multiple records on the List page at the same time you
can create new button Update
selected, then choose records on the List page and click the
Update selected button.
Note: Change
the values listed in red to
match your specific needs.
1. Proceed to the Visual
Editor page.
2. Create the custom button
Update selected and add the
following code
to the Server tab:
|
global $dal;
for ($i=0;
$i<count($keys);
$i++)
{
// set
ReportsTo field to 'Bob Smith'
$sql
= "Update employees set ReportsTo='Bob Smith'
where KeyField="
. $keys[$i]["KeyField"];
CustomQuery($sql);
}
$result["txt"]
= "Records were updated.";
|
and to the Client After
tab:
|
var message =
result["txt"];
ctrl.setMessage(message);
|
The Client Before tab
should be blank (delete sample code there if any).
For more information about using Data Access Layer (DAL), see
Data Access Layer.
|