我希望你们都做得很好。我在自定义模块和自定义关系之间创建了1:M关系,使用此script.we在根文件夹中运行此脚本。1:M关系运行良好,关系观也很完善。
<?php
require_once 'vtlib/Vtiger/Module.php';
require_once 'modules/ModComments/ModComments.php';
$commentsModule = Vtiger_Module::getInstance('ModComments');
$fieldInstance = Vtiger_Field::getInstance('related_to', $commentsModule);
$fieldInstance->setRelatedModules(array('Laptop'));// Here is my Custom Module Name
$detailviewblock=ModComments::addWidgetTo('Laptop');
echo "Comments have been added for Your_Custom_Module_Name Module";
?>
```发布于 2022-07-22 06:55:15
似乎您正在将注释模块与另一个模块关联起来。这些脚本用于向其他模块添加和删除ModComments,只需用模块名替换模块:
添加:
<?php
include_once 'vtlib/Vtiger/Module.php';
require_once 'modules/ModComments/ModComments.php';
$moduleNames = 'MODULE';
ModComments::addWidgetTo($moduleNames);
?>移除:
<?php
include_once 'vtlib/Vtiger/Module.php';
require_once 'modules/ModComments/ModComments.php';
$moduleNames = 'MODULE';
ModComments::removeWidgetFrom($moduleNames);
?>https://stackoverflow.com/questions/73047894
复制相似问题