Hi i have a mysql database, and a fairly large crm system, there are some
entries in my database which being deleted somehow, and there are a few
different delete option pages.
is there away of getting an email sent to me when a row is deleted from a
table called enquiries, with the actual page name that delete accured, so i can
find out where this is happening.
so i would get an email with
item deleted from table enquiries
this was deleted from page deleteenquiry.cfm
Azadi - 11 Sep 2007 12:06 GMT
for starters, just put an appropriate cfmail tag right after any delete
cfquery you want to keep an eye on - that will fire off every time the
delete query is executed
as for requesting page name - depends where your delete queries are: if
in cfc's you will probably have to pass in another argument with current
page's name into the cfc and then use it in the cfmail; if they are in
same cfm pages as the link/button to execute deletion, then use
cgi.script_name; if the delete query is in a separate cfm page (i.e.
delete_email.cfm), then try using cgi.http_referer instead (not sure
about this one if the delete is fired through form submission, though,
but will probably work, too...)
as alternative to email, consider using <cflog> tag....

Signature
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
KeithLaw999 - 11 Sep 2007 12:33 GMT
yes but what i am looking for is a global solution, so is there a way of using the application page to send me an email if the delete function is used?
Azadi - 11 Sep 2007 13:04 GMT
i see...
i am afraid there is no easy solution like that, if any at all...
technically, one probably (this is me just hypothesising here...) could
"under the hood" of cfquery tag and write some custom java which extends
it to do what you want.... but i guess this will also bee way too
rdbms-specific to implement on any wider scale...
but then again i may be wrong, and someone smarter than me is meanwhile
typing exactly the code you need...

Signature
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
GArlington - 11 Sep 2007 14:27 GMT
> yes but what i am looking for is a global solution, so is there a way of using the application page to send me an email if the delete function is used?
What you might be able to use is a DB trigger, it is DB specific so
you will have to look it up how to do that depending on you setup.
MEsquivel - 11 Sep 2007 15:43 GMT
What DBMS are you using?
Can you add a trigger to that table, in order to insert information on a log
table on the delete event, and have a CF component read this log and send the
mail to you?
Not really sure if this is what you're looking for ...