Please enable JavaScript to view this site.

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

PHPrunner32x32     ASPRunnerPro manual

Event: AfterAdd

Scroll Prev Next More


The AfterAdd event is executed after the record is physically added to the database. It works in all add modes: Inline Add, Regular Add and an Add page in a popup.


AfterAdd(values, keys, inline, pageObject)


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"].



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



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



equals to '1' for the Inline Add, '0' otherwise.


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

Note: 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


Passing true to pageObject.stopPRG = true variable named "saved":


pageObject.stopPRG = true
pageObject.setProxyValue "saved", 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

See also:

AJAX helper object: setMessage()

About Javascript API


Custom add

Before record added

Choose pages screen

About SQLQuery class

About SQLQuery screen

Additional WHERE tabs