After adding email addresses to a custom module I get a PHP error on getAddressesByGUID()

I added email addresses to a custom module using vardefs Extensions:

<?php
$dictionary['cust_CustomerSanctions']['uses'] = array('email_address');
VardefManager::createVardef("cust_CustomerSanctions", "cust_CustomerSanctions", array('email_address'));
?>

I can create a record just fine, but when I try to load the record view I get a 500 error and the pho logs show:

PHP Fatal error:  Uncaught Error: Call to a member function getAddressesByGUID() on null in /var/www/html/sugarcrm/include/SugarFields/Fields/Email/SugarFieldEmail.php:39\nStack trace:\n#0 /var/www/html/sugarcrm/data/SugarBeanApiHelper.php(74): SugarFieldEmail->apiFormatField(Array, Object(cust_CustomerSanctions), Array, 'email', Array, Array, Object(RestService))\n#1 /var/www/html/sugarcrm/include/api/SugarApi.php(77): SugarBeanApiHelper->formatForApi(Object(cust_CustomerSanctions), Array, Array)\n#2 /var/www/html/sugarcrm/clients/base/api/ModuleApi.php(483): SugarApi->formatBean(Object(RestService), Array, Object(cust_CustomerSanctions))\n#3 /var/www/html/sugarcrm/include/api/RestService.php(306): ModuleApi->retrieveRecord(Object(RestService), Array)\n#4 /var/www/html/sugarcrm/api/rest.php(23): RestService->execute()\n#5 {main}\n  thrown in /var/www/html/sugarcrm/include/SugarFields/Fields/Email/SugarFieldEmail.php on line 39, referer: <mysugarinstance>/index.php?module=Home&action=index

Any thoughts on what I'm missing?

Thanks,

FrancescaS

Parents Reply Children
No Data