Please enable JavaScript to view this site.

Navigation: Advanced topics > Events > Predefined actions

Events. Check if specific record exists

Scroll Prev Next More

 

Check if specific record exists action uses Database API  to check if a Specific Value exists in the table.

 

Insert your code into the conditional statement instead of the comments to determine what happens if the Specific Value already exists or if it doesn't.

 

This action is available at any event except JavaScript onload events.

check_if_specific_record_exists_select_acion

 

 

 

//**********  Check if specific record exists  ************
$rs = DB::Query("select * from AnyTable where SomeColumn='Specific Value'");
$data = $rs->fetchAssoc();
if($data)
{
  // if record exists do something
}
else
{
  // if dont exist do something else
}

See also:

Database API:Query()

Database API: fetchAssoc()

JavaScript API: getSelectedRecords()

JavaScript API:getSelectedRecordKeys()

Database API:Select()

Update multiple records on the List page

 

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