Please enable JavaScript to view this site.

Navigation: Advanced topics > Events > Table events > Edit page

PHPrunner32x32     ASPRunnerPro manual


Event: BeforeEdit

Scroll Prev Next More

Description

The BeforeEdit event is executed before the data record is updated in the database. It works in all edit modes: Inline Edit, Regular Edit and an Edit page in a popup.

Syntax

BeforeEdit(values, where, oldvalues, keys, message, inline, pageObject)

Arguments

Note: Field names are case-sensitive. If the field name is PlayerId, you should use values("PlayerId"). Note that values("playerid") or values("PlayerID") will not work.

 

Note: If the field was assigned an alias in the SQL query, then the values array will get the alias instead of the field name from the database.

E.g., if you have an SQL query SELECT salesrep_id AS Inv_Salesrep ..., you should use values["Inv_Salesrep"].

 

values

an array of values to be written to the database. To access a specific field value, use values("FieldName").

where

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

oldvalues

an array with existing field values. To access a specific column value, use oldvalues["FieldName"]

keys

an array of key column values that point to the edited record. To access specific key column, use keys["KeyFieldName"].

message

place the message to be displayed into this variable.

inline

equals to 1 for the Inline Edit, 0 otherwise.

pageObject

an object representing the current page. For more information, see RunnerPage class.

Return value

True: the changes are saved.

 

False: the changes are not saved.

Applies to pages

Edit, Inline Edit.

Recommended  sample events:

Update multiple tables

Send an email with updated fields only

Send mass email to all users

Rename uploaded files

Check if start date is ealier than end date

See also:

Choose pages screen

About SQLQuery class

About SQLQuery screen

Additional WHERE tabs

How to control Inline Add/Edit functionality from script

Javascript API: InlineRow object

Before record added

Custom record update

After record update updated