sugarcrm - 将用户输入添加到已编辑字段
问题描述
如果用户决定更改字段值,我想添加一个编辑功能,但我似乎找不到正确的方法来做到这一点。我试过通过谷歌搜索,但它没有给出与这个问题相关的任何答案。
代码在这里:
<?php
class CloseTicket
{
public function do_CloseTicket($bean, $events, $args)
{
//checks if the ticket is already in use
if(!isset($bean->fetched_row['field_name_id'])){
if (!empty($bean->field_name)) {
//if ticket status is closed then it displays an error message
$module = BeanFactory::getBean("CUSTOM MODULE", $bean->field_name_id);
if ($module->status == 'Closed') {
SugarApplication::appendErrorMessage("Ticket is already used. Please use another Ticket.");
$params = array(
'module' => 'Module',
'action' => 'ListView',
'record' => $bean->id,
);
SugarApplication::redirect('index.php?' . http_build_query($params));
//else adds the ticket then closed it
} else {
$module->status = "Closed";
$module->save();
}
}
//if ticket is already taken then it display an error message
} else {
SugarApplication::appendErrorMessage("Ticket is already attached.");
$params = array(
'module' => 'module',
'action' => 'ListView',
'record' => $bean->id,
);
SugarApplication::redirect('index.php?' . http_build_query($params));
}
}
}
解决方案
我不能完全理解你的问题。
但是,如果您尝试编辑重复的相关 bean,则参数应该是EditView
这样的ListView
:
$params = array(
'module' => 'Module',
'action' => 'EditView',
'record' => $bean->id,
);
SugarApplication::redirect('index.php?' . http_build_query($params));
推荐阅读
- javascript - 如何使用工作箱测试预缓存?
- hadoop - 合并 HDFS 中的文件夹
- javascript - 如何在邮件中选择下拉列表值
- javascript - 如何将字符串转换为对象并在循环 javascript 中使用?
- machine-learning - 卷积中的膨胀内核与内核 5x5
- javascript - 未捕获的 ReferenceError:使用 babel 编译并加载到浏览器后未定义要求
- mysql - 可以在没有重大中断的情况下移动数据库吗?
- flutter - 颤振屏幕导航
- flutter - 如何使用颤振在oneSignal中查看特定用户的通知历史记录
- html - 如何在 html 中动态添加预览或选择字体以获取 google app script html 文件中的字体大小和字体类型