acumatica - 如何在 AP 503000 屏幕中向进程按钮添加条件
问题描述
当我单击进程按钮时,我需要显示一条消息。如果选择的金额大于 700 并且低于,则不显示消息。
但是通过单击确定。显示此消息
我的代码是:
提前谢谢了!
解决方案
避免在 RowSelected 方法中显示对话框。每次获取记录时都会调用该方法,因此它将以无法控制的循环显示它。
还要检查对话框的返回值以了解按下了哪个按钮。
要在按下 Process 按钮时显示对话框,请覆盖 Process 方法。您可能必须根据上下文(PXGraph/PXGraphExtension)更改“Base”:
[PXProcessButton]
[PXUIField(DisplayName = "Process", MapEnableRights = PXCacheRights.Update, MapViewRights = PXCacheRights.Update)]
protected override IEnumerable Process(PXAdapter adapter)
{
if (Base.Ask("ConfirmationTitle", "ConfirmationMessage", MessageButtons.YesNo) != WebDialogResult.Yes)
{
// Click on No, don't execute the base Process action
return adapter.Get();
}
// Click on Yes, execute the base Process action
return Base.Process(adapter);
}
推荐阅读
- node.js - 是否可以仅使用 .json 文件在 node.js 中运行 Spine 动画?(脊柱运行时库)
- ios - 当新的视图控制器被激活时,变量数据被删除
- r - 在 R 中作为开发人员存储和更新包数据的最佳方式?
- python - 将一列分成两列并在熊猫中组合
- mysql - Laravel softdeleteable 的 MySQL / MariaDB 分区(deleted_at IS NULL vs datetime value)
- powershell - PowerShell File Watcher Register-ObjectEvent - 等待文件完成复制
- c# - 如何使用 RavenDB 3.5 创建一个模拟内部连接的索引?
- python-3.x - Scrapyjs + Splash 不会从 XHR 请求中检索动态加载的内容
- node.js - 安装模块时出错
- amazon-web-services - 如何在 Lambda 中处理与 RDS 的连接丢失?