Global events Home

Introduction
Welcome
System requirements
Licensing details
What is the registration
Using ASPRunner
Working with projects
Templates
What are templates
Cars
Classified ads
Events
Jobs
Knowledge base
News
Paypal
Real estate
Sporting
Vacation houses
Connecting to the database
Datasource tables
SQL query page
About SQL query designer
Query Designer
SQL
Results
Charts
Creating chart and setting parameters
Chart appearance
Using SQL to shape chart data
Reports
Creating report and setting parameters
Report totals and layout
Choose pages
Login page
User login settings
Advanced security settings
User group permissions
Fields order and totals
Miscellaneous settings
Choose theme
Visual Editor
About
Toolbars
Page Elements
"View as" settings
"Edit as" settings
Validation types
Lookup wizard
Events
Output directory settings
After you are done
FTP upload
FrontPage Publishing
Advanced topics
Connecting to database
Connecting to MS Access database
Connecting to MS SQL Server database
Connecting to FoxPro database
Connecting to MySQL database
Connecting to Oracle database
Connecting to MS Excel database
Connecting to CSV or Text file
Events
More about events
Global events
Table events
Page life cycle overview
Predefined actions
Send simple email
Send email with new data
Save new data in another table
Insert a record into another table
Check if specific record exists
Display a message on the Web page
Redirect to another page
Custom code
Sample code
Show list of customer orders
Check if start date is ealier than end date
Before deleting a record check if related records exist
Speed up data entry using events
Publishing ASP application to the remote Web server
Using third party FTP client to publish ASP pages to the remote Web server
Using FrontPage to publish ASP pages to the remote Web server
Demo account
What is the Demo Account?
Terms and Conditions
Master-details relationships
Using JOIN SQL queries
AJAX-based Functionality
ASPRunner session variables
Debugging tips
Template files processing rules (Files.txt)
Multilanguage support
Useful functions and links
Smarty templates
Stylesheets
Template language
Rich Text Editor plugins
How to control Inline Add/Edit functionality from script
Troubleshooting "Operation must use an updateable query" errors
ODBC
Upgrade Guide from ASPRunnerPro 4.0 and older
Frequently Asked Questions
Error: Operation must use an updateable query.
Error: Syntax error in UPDATE statement.
Error: Syntax error in INSERT INTO statement
Error: Login failed for user 'MACHINE_NAME\IUSR_MACHINE_NAME'
Error: Data type mismatch in criteria expression
Error: The Microsoft Jet database engine cannot open the file (unknown).
Error: Unable to open registry key 'Temporary (volatile) Jet DSN for process ...
Error: Data provider could not be initialized
Error: Invalid use of Null: 'Replace'
Error: Specified driver could not be loaded due to system error 5 (Oracle in OraHome92)
How can I add new ODBC Datasource
Error: Too many fields defined
Error: I enter correct login and password but receive Invalid Login error. I use SQL Server.
I cannot find ODBC Administrator applet on Windows 2000 machine
I cannot connect to my Excel (Access) database
Where can I download latest ODBC drivers
How to work with Access database stored on the remote computer?
Reserved Access, T-SQL, ODBC keywords.
Order ASPRunner online

 
 ASPRunner manual


Table events

Table events belong to a table or a view.

 

Quick jump

Before page processed

Before record added

After record added

Before record deleted

After record deleted

After group of records deleted

Before record updated

After record updated

Copy page: OnLoad

Before SQL query

Before page is displayed

Before record processed

After record processed

Before page processed

BeforeProcess<page name>($conn)

Executed in the beginning of each ASP file, right after database connection is established.

Pages:

List, View, Add, Edit, Print, Search, Export, Report, Chart

Arguments:

$conn - database connection

 

Before record added

BeforeAdd(&$values)

Executed before record is physically added to the database

Pages:

Add, Inline Add

Arguments:

$values - array of values to be written to the database.

To access specific field value use $values["FieldName"]

Return value:

True: continue with adding a record

False: record would not be added

 

After record added

AfterAdd(&$values,&$keys)

Executed before record is physically added to the database

Pages:

Add, Inline Add

Arguments:

$values - array of values in the new record. To access specific field value use $values["FeildName"]

$keys - array of key column values that point to the new record. To access specific key column use $keys["FieldName"]

 

Before record deleted

BeforeDelete($where, &$deleted_values)

Executed before record is deleted

Pages:

List

Arguments:

$where - WHERE clause that points to the record to be deleted. Example: ID=19

$deleted_values - array of values of the record to be deleted. To access specific field value use $deleted_values["FeildName"]

Return value:

True - record will be deleted

False - record would not be deleted

 

After record deleted

AfterDelete($where, &$deleted_values)

Executed after record is deleted

Pages:

List

Arguments:

$where - WHERE clause that points to the record to be deleted. Example: ID=19

$deleted_values - array of values of the record to be deleted. To access specific field value use $deleted_values["FeildName"]

 

After group of records deleted

AfterMassDelete($records_deleted)

Executed after bulk delete operation

Pages:

List

Arguments:

$records_deleted - number of records that were deleted

 

Before record updated

BeforeEdit(&$values, $where, &$oldvalues, &$keys)

Executed before data record is updated in the database

Pages:

Edit, Inline Edit

Arguments:

$values - array of values to be written to the database

$where -WHERE clause that points to the edited record. Example: ID=19

$oldvalues - array with existing field values. To access specific column value use $oldvalues["FieldName"]

$keys - array of key column values that point to the new record. To access specific key column use $keys["FieldName"]

Return value:

True: changes will be saved

False: changes would not be saved

 

After record updated

AfterEdit(&$values, $where, &$oldvalues, &$keys)

Executed after data record is updated in the database

Pages:

Edit, Inline Edit

Arguments:

$values - array

$where - WHERE clause that points to the edited record

$oldvalues - array with existing field values. To access specific column value use $oldvalues["FieldName"]

$keys - array of key column values that point to the new record. To access specific key column use $keys["FieldName"]

 

Copy page: OnLoad

CopyOnLoad(&$values, $where)

Executed when Add page is loaded in Copy mode

Pages:

Add (in Copy mode)

Arguments:

$values - array with existing field values. To access specific column value use $values["FieldName"]

$where - WHERE clause that points to the record to be copied. Example: ID=19

 

Before SQL query

BeforeQuery<page name>(&$strSQL)

Executed before SELECT SQL query is processed. Use this event if you like to modify default SQL query, add a WHERE clause etc.

Pages:

List, Print, Export, Report, Chart, View, Edit

Arguments:

$strSQL - SQL query.

 

Before page is displayed

BeforeShow<page name>(&$smarty,&$templatefile)

Executed right before page is displayed in the browser. Use this event to modify the value of any Smarty variable or to define a new one.

Pages:

List, View, Add, Edit, Print, Search, Report, Chart

Arguments:

$smarty - Smarty object

$templatefile - template file name

 

Before record processed

BeforeProcessRow<page name> (&$data)

Executed right after database record is retrieved from the database before formatting is applied.

Pages:

List, Print

Arguments:

$data - array with raw database record data. To access specific column value use $data["FieldName"].

Return value:

True - record will be shown on the page

False - record will be skipped

 

After record processed

BeforeMoveNextList(&$data,&$row,$col)

Executed after record is processed and formatting is applied.

Pages:

List, Print

Arguments:

$data - array with raw database record data. To access specific column value use $data["FieldName"].

$row - array with the formatted record

$col - column number (if you use multicolumn layout).

To access specific field value use $row[$col."FieldName_value"].

In single-column layout use $row["1FieldName_value"]

 

The CHM file was converted to HTML by chm2web software.