AnsweredAssumed Answered

How to fetch case id in from edit view?

Question asked by Hemant Aseri on Jul 8, 2014
Latest reply on Jul 11, 2014 by paperless
Hi,
 I want to fetch record id in edit view. I am doing email send code on save button click in cases module and i want to fetch data of Account by relate field. I had try to fetch data on basis of record id in edit view but i didn't get any output. I am doing code in custom/modules/cases
and calling file in logic_hooks.php on after save
So please anyone tell me how i will fetch record id in edit view and account data by relate field.

This is my code file:

require_once('custom/classes/mailCstm.php');include("config.php");
global $sugar_config;
class Recovered{

    function createRecovered(&$bean, $event, $arguments) {

       
         if($_REQUEST['action']=='Save')
       {
       
  if($bean->status=="Closed" && $bean->substatus_c=="Recovered"){
    
    $this->sendMail($bean);
   }
      

}

        
    }
    function sendMail($bean)
    {
       //echo "hi";
       //exit;
       $date=$bean->date_modified;
    $exdate= explode(" ", $date);
    $datemod=$exdate[0];
    $session=date("F d,Y", strtotime($datemod));
    
    $contact=$bean->contact_name_c;
    $first= explode(" ", $contact);
    $name=$first[0];
    $account= $bean-> account_name;
    
$siteurl=$sugar_config['site_url'];
$localhost = $sugar_config['dbconfig']['db_host_name'];
$user = $sugar_config['dbconfig']['db_user_name'];
$password = $sugar_config['dbconfig']['db_password'];
$db_name = $sugar_config['dbconfig']['db_name'];
$conf = mysql_connect($localhost, $user, $password);
$db = mysql_select_db($db_name);

$value = $_REQUEST['id']
$sql= "SELECT * FROM 'cases' where account_id";

Thanks:

Outcomes