AnsweredAssumed Answered

logic hook in Contracts wiping out records and not saving new records

Question asked by KarenV KarenV on Sep 14, 2015
Latest reply on Sep 15, 2015 by KarenV KarenV
I have a logic hook in Contracts which is bwc module. All I want it to do is grab the date from one field and put it in another. I've done this multiple times with modules that have been added to the 7.x framework but this is the first time I've had to deal with a bwc module. 

My code is as follows:
  $hook_version =1;
  $hook_array = Array();

  $hook_array['before_save'] = Array();
  $hook_array['before_save'][] = Array(
   1, 

   //String to identify the hook
   'term_to_expiration',

   //PHP file path
   'custom/Extension/modules/Contracts/Ext/LogicHooks/term_expiration_renewal.php',

   //The Class method exists
   'Contracts_Dates',

   //Method
   'install_plus_term'

  );

  if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Point');

  class Contracts_Dates
  { 
   function install_plus_term($bean, $event, $arguments)
   { 
    if(isset($bean->install_date_c) == TRUE)
    {
     $install_date = $bean->install_date_c
     $bean->test_c = $install_date;

    }
  }

Do bwc modules follow a different format for logic hooks or what am I missing?
We have an on-premise instance. Enterprise 7.5.0.1

Thank you in advance!

Outcomes