Sugarcrm支持产品指南糖开发人员糖开发人员指南10.3建筑学糖逻辑依赖行动setPanelvisibility.
此版本仅适用于Sugarcloud客户。

setPanelvisibility.

概述

The SugarLogic setPanelvisibility. action, defined in ./include/Expressions/Actions/PanelVisibilityAction.php, is used to determine the visibility of a record view panel based on a formula. 

执行

While the dependency metadata for your module can be defined in ./modules/<module>/metadata/dependencydefs.php and  ./custom/modules/<module>/metadata/dependencydef.php, it is recommended to use the 扩展框架 自3d彩吧论坛库存模块以防止第三方插件与您的自3d彩吧论坛相冲突。以下部分将演示如何实现只读依赖项。

setPanelvisibility参数

范围 类型 描述
目标 细绳 隐藏面板的ID
价值 细绳 用于确定面板是否应可见的公式。

有关依赖性3d彩吧论坛中各种参数的更多信息,请参阅 依赖行动 documentation.

例子

For our example, we will create a dependency on the Cases module that will hide a specific panel if the status field on a case is set to "Closed". Our example extension definition is shown below: 

./custom/extension/modules/<module>/ ext/dependencies/hide_panel_2_dep.php.

<?php

$dependencies['Cases']['panel_2_visibility'] = array(
    'hooks' => array("edit","view"),
    'trigger' => 'equal($status, "Closed")',
    'triggerFields' => array('status'),
    'onload' => true,
    //Actions is a list of actions to fire when the trigger is true
    'actions' => array(
        array(
            'name' => 'SetPanelVisibility',
            'params' => array(
                'target' => 'detailpanel_2',
                'value' => 'true',
            ),
        )
    ),
    //notActions is a list of actions to fire when the trigger is false
    'notActions' => array(
        array(
            'name' => 'SetPanelVisibility',
            'params' => array(
                'target' => 'detailpanel_2',
                'value' => 'false',
            ),
        ),
    ),
);

有文件到位后,您需要导航到管理员> Repairs >并进行快速修复和重建。

笔记:重要的是,模块名称是复数(“案例”与“案例”),并且依赖关系的名称“Panel_2_visibility”在此示例中,是唯一的。

 

最后修改:2021-01-06 23:28:41