Please enable JavaScript to view this site.

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

Events.After record added

Scroll Prev Next More

Description

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.

Syntax

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

 

keys

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

 

inline

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

pageObject

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

Example

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

setProxyValue

Custom add

Before record added

Choose pages screen

About SQLQuery class

About SQLQuery screen

Additional WHERE tabs