Please enable JavaScript to view this site.

ASPRunnerPro 10.2 Manual

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

PHPrunner32x32     ASPRunnerPro manual


Event: BeforeEdit

Scroll Prev Next More

 

Description

 

Function BeforeEdit is executed before a data record is updated in the database. Will work in all edit modes: Inline Edit, Regular Edit and Edit page in popup.

 

Syntax

 

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

 

Arguments

 

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

 

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.

 

If the field was assigned an alias in the SQL query, then the values array will get the alias instead of field name from the database. E.g. if you have SQL query select salesrep_id AS Inv_Salesrep ..., you should use values("Inv_Salesrep").

 

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

 

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

 

Field names are case-sensitive. If the field name is PlayerId, you should use oldvalues["PlayerId"]. Note that oldvalues["playerid"] or oldvalues["PlayerID"] will not work.

 

If the field was assigned an alias in the SQL query, then the oldvalues array will get the alias instead of field name from the database. E.g. if you have SQL query select salesrep_id AS Inv_Salesrep ..., you should use oldvalues["Inv_Salesrep"].

 

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

 

Field names are case-sensitive. If the field name is PlayerId, you should use keys["PlayerId"]. Note that keys["playerid"] or keys["PlayerID"] will not work.

 

message - place the message to be displayed into this variable.

 

inline - equals to '1' when the Inline Edit in process, '0' otherwise.

 

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

Return value

 

True: changes will be saved.

 

False: changes would not be saved.

 

Applies to pages

 

Edit, Inline Edit

 

Recommended  sample events

Update multiple tables

Send an email with updated fields only

Send mass email to al users

Rename uploaded files

Check if start date is ealier than end date