Navigation: Advanced topics > Events > Sample events > Database
Before deleting a record in the Orders table, check for related items in the OrderDetails table. Add the following code to the List page: Before record deleted event.
dynamic tblModels = GlobalVars.dal.Table("Order_Details");
XVar rs = tblModels.Query("OrderID='" + deleted_values["OrderID"].ToString() + "'", "");
XVar data = CommonFunctions.db_fetch_array(rs);
•Check if specific record exists
•Master-details relationship between tables