Please enable JavaScript to view this site.

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

Events.Before record updated

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"]. Note: in case of Update Selected $values array will only contain those fields that user have selected to update.

$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

message to be displayed to the end user if false is returned and edit is canceled.

$inline

true for the Inline Edit or Edit in popup, false otherwise.

$pageObject

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

Return value

true: the changes will be saved.

 

false: the changes will not saved.

Applies to pages

Edit, Inline Edit, Update Selected

 

Note: In case of Update Selected page

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

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software