This topic is locked

Emailing Record from View Page

3/28/2014 2:22:24 PM
PHPRunner General questions
D
dustinforehand author

Good Afternoon.. Was hoping to get some help. I have been running through the forums and examples and can not seem to get this to work.

After trying other examples with Buttons in data-grid, and emailing selected records I am still at a loss. I am hoping someone can help me.
I would like to put a button on the view page of my application, that will email the record info to the email in the email field.

I have tried playing around with the following code and hoping for some more insight on how to accomplish this. Any help is greatly appreciated.
My table is: log

My Fields are: log_id, user, date, case
This is the code I used on the Server Tab

$email="myemail@gmail.com";

$message="";

$subject="Mail Log Record";

$message.="log_id:".$values["log_id"]."\r\n";

mail($email, $subject, $message);

Sergey Kornilov admin 3/28/2014

Button doesn't provide access to $values array. You need to use getCurrentRecord() API function to get access to the current record data:

http://xlinesoft.com/phprunner/docs/button_getcurrentrecord.htm