Please enable JavaScript to view this site.

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

Before record inserted

Scroll Prev Next More

Description

The BeforeInsert event is executed before a record is inserted during import. Use this event to modify the import data before it is saved in the database.

Syntax

BeforeInsert($rawvalues, $values, $pageObject, $message)

Arguments

$rawvalues

raw field values from the imported file.

$values

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

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

 

$pageObject

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

$message

this message will be added to the Import Log if the record wasn't imported

Return value

True - the record is inserted.

 

False - the record is not inserted.

Applies to pages

Import.

Recommended predefined actions and sample events:

Insert a record into another table

Check to see if a specific record exists

Display a message on the Web page

See also:

After import finished

Before import started

Export/Import pages

AJAX helper object: setMessage ()

 

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