Contents

 
Home
ASPRunner Professional 7.0 manual
Prev Page Next Page
 
 

Update multiple records on the List page

 

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.

yellowbulbNote: 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:

if keys.Count>0 then

  for i=0 to keys.Count-1

     ' set ReportsTo field to 'Bob Smith'

     sql = "Update employees set ReportsTo='Bob Smith' _

        where KeyField=" & keys(i)(KeyField)

     dbConnection.Execute sql

  next

  result("txt") = "Records were updated."

end if

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). KeyField is a primary key in the table.

Converted from CHM to HTML with chm2web Standard 2.85 (unicode)