0

创建新记录时,我试图将值从相关字段复制到自定义模块的名称字段。为此,我使用以下 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; } } ?>
4

1 回答 1

0

检查您的Apache/PHP日志是否有错误。那里应该会弹出一些东西。

于 2015-10-01T21:17:40.057 回答