Please enable JavaScript to view this site.

ASPRunnerPro 10.2 Manual

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

PHPrunner32x32     ASPRunnerPro manual


Event: AfterAdd

Scroll Prev Next More

 

Description

 

Function AfterAdd is executed after a record is physically added to the database. Will work in all add modes: Inline Add, Regular Add and Add page in popup.

 

Syntax

 

AfterAdd(values,keys,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").

 

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.

 

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.
 

If you need to display a message on the page or pass a variable value to JavaScript you need to add the following to the end of your event code:

 

pageObject.stopPRG = true

 

A complete code example. Passing the value of true to JavaScript variable named "saved":

 

pageObject.setProxyValue "saved", true
pageObject.stopPRG = true

 

Applies to pages

 

Add, Inline Add

 

Recommended  sample events

Add new button to Add/Edit pages

Change message after record was added or saved

Redirect to details page after master record was added

Send mass email to al users

Speed up data entry using events