Please enable JavaScript to view this site.

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

Custom add

Scroll Prev Next More


The CustomAdd event is executed before the record is physically added to the database. It is designed to replace the standard Add procedure.


Use it when you do not want record to be added to the table in question.


CustomAdd($values, $keys, $error, $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 new record. To access a specific key column, use $keys["KeyFieldName"].


place the message to be displayed into this variable.


equals to true for the Inline Add, false otherwise.


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

Return value

True: if you want the application to handle adding the record.


False: if you have added the record with your code.

Applies to pages

Add, Inline Add.


Lets consider the situation when records are never added directly to the main table (e.g., Cars).


Instead, records are added to the temporary TempCars table and then moved to the main Cars table once approved by the admin.


In this case, the following code in the CustomAdd event will do the job:


global $dal;
$tblTempCars = $dal->Table("TempCars");
return false;


Note: You may have noticed that the BeforeAdd event does the similar job. The main difference is that returning false in the BeforeAdd event is considered an error, and the user will see that something went wrong. Returning false in the CustomAdd event is perfectly legitimate, and application execution continues after that.

See also:

How to control Inline Add/Edit functionality from script

Javascript API: InlineRow object

After record added

Choose pages screen

About SQLQuery class

About SQLQuery screen

Additional WHERE tabs


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