delete button

I have a grid that has my main data, there is a related table that contains a series of dates (visits). If a visit gets entered accidentally I want to be able to delete it. I have a form that pops up in the main grid allowing you to edit the visit, I put a delete button on the form and have a field called deleteMe. If deleteMe is 0 the record was edited if the record should be deleted I set deleteMe to the record id. It does not Delete the record. What did I miss?

This is the client side code
VerifyVisitForm.attachEvent(“onButtonClick”, function(name, command){

This is the server side code.
$VerifyVisitForm->event->attach(“beforeRender”, “removeVisit”);

function removeVisit($action){
$sql = “DELETE FROM Visitdates WHERE id=”.$id.")";

Try to enable logging on server side and check if any issues occurs while record deleting … nd_logging

Thanks turns out it was a syntax error, but even stranger it claimed the sql statement ran. Is this the best way to accomplish a delete, it sure seems like a roundabout way, given the high level of functionality of your components.