创建新记录时,我尝试将值从关联字段复制到自定义模块的名称字段。为此,我使用以下logic_hook:
<?php
// Do not store anything in this file that is not part of the array or the hook version. This file will
// be automatically rebuilt in the future.
$hook_version = 1;
$hook_array = Array();
// position, file, function
$hook_array['before_save'] = Array();
$hook_array['before_save'][] = Array(1, 'Value from one field to another', 'custom/modules/chan_channelpartner/textcopy.php', 'textcopy','textcopy');
?>
这是我的textcopy.php文件:
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class textcopy
{
function textcopy($bean, $event, $arguments)
{
$bean->name = $bean->namenew_c;
}
}
?>
运行此文件时,我的浏览器会返回一个白色屏幕,其中包含以下文字:
name = $bean->namenew_c; } } ?>
答案 0 :(得分:0)
检查 Apache / PHP 日志中的错误。那里应该有东西出现。