AnsweredAssumed Answered

Custom Field Source-Non DB save to DB????

Question asked by Lance Devin on Mar 31, 2015
Latest reply on Mar 31, 2015 by Sagar Salunkhe
Sugar 6.5.17 Professional

I have created the following field:
  'flatconfig_c', 
      'vname' => 'Flat Config', 
      'type' => 'varchar', 
      'source' => 'non-db', 
   'studio' => 'visible',
      'function' => 
       array(
      'name' => 'ldFlatten',
      'returns' => 'html',
      'include' => 'custom/modules/dcopp_EDC_Opportunities/Ext/fLDFlatten.php',
            'params' => array('date_modified'), 
            'params_source' => 'this',
          ),
);
?>

And the associated function returns an html table of related module records and it displays properly.

Name Cabinet Qty Total Receptacle Count Design Load per Cab Design Load Ext
test cab 2 2 4 6.180 12.360
test cab 1 2 3.840 3.840

However, I cannot use the field flatconfig_c in a workflow email as it doesn't write to a database (the field is temporal I guess).  How can I get the flatconfig_c field to write to a database?  I tried creating a calculated text field (UberConfig_c) that equals the value of Flatconfig_c, but that doesn't work either.  

I tried setting the dbtype to varchar, but that didn't work (yes I did a quick repair).  Can I remove the source = non-db?  Can you have a function field that writes to a database? If so how? 

I can tell you that all this is very very poorly documented.  I have looked everywhere and your help is greatly appreciated.

Outcomes