Description
The BeforeAdd event is executed before the record is physically added to the database. It works in all add modes: Inline Add, Regular Add and an Add page in popup.
Syntax
BeforeAdd(values, message, 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 list of values to be written to the database. To access a specific field value, use values("FieldName")
message
message to display to the end user in case if you return false.
inline
1 for the Inline Add or Add in popup, 0 for the standalone Add page.
pageObject
an object representing the current page. For more information, see RunnerPage class.
Return value
True: continue adding the record.
False: the record would not be added.
Applies to pages
Add, Inline Add.
Recommended sample events:
•Limit number of records users can add
•Speed up data entry using events
See also:
•How to control Inline Add/Edit functionality from script
•Javascript API: InlineRow object