无法在案例中启用自定义字段 [英] Unable to enable a custom field in Cases

查看:26
本文介绍了无法在案例中启用自定义字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当状态处于关闭状态时,我试图在案例中启用自定义字段.我正在为 Acumatica 版本 20.114.0020 (2020 R1) 进行自定义.

I am trying to enable the custom field in Case when the Status is in Closed State. I am working on a customization for Acumatica version 20.114.0020 (2020 R1).

我在 CRCase DAC 中创建了一个自定义字段 usrIsNotBillable.

I have created a custom field usrIsNotBillable in CRCase DAC.

[PXDBBool]
[PXUIField(DisplayName="Confirmed Not Billable", Enabled = true)]
public virtual bool? UsrIsNotBillable { get; set; }
public abstract class usrIsNotBillable : PX.Data.BQL.BqlBool.Field<usrIsNotBillable> { }

当 Case 处于 Closed 以外的其他状态时,它完全可以正常工作.但是当案件结束时,所有其他财产都会被禁用.但我希望将此字段设置为启用.因此,我重写了 CRCaseMaint 图的 Row Selected 方法,如下所示:

It is totally working fine when the Case is in other states than Closed. But when the case is closed, every other property gets disabled. But I want this field to be set enabled. So, I override the Row Selected method for CRCaseMaint graph as below:

protected void CRCase_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
    {
            InvokeBaseHandler?.Invoke(cache, e);
            CRCase row = (CRCase) e.Row;
            if (row == null) return;
            Base.CaseCurrent.Cache.AllowUpdate = true;
            Base.CaseCurrent.AllowUpdate = true;
            PXUIFieldAttribute.SetEnabled<CRCaseExt.usrIsNotBillable>(cache, row, true);
    }

如果我像这样使用其他 DAC 字段,例如 IsBillable:

If I use other DAC fields such as IsBillable like this:

PXUIFieldAttribute.SetEnabled<CRCase.isBillable>(cache, row, true);

它工作正常.

我也检查了其他示例,实现与此类似.我只是不确定为什么它在这种情况下不起作用.

I checked other examples too and the implementation is similar to this. I am just not sure why it is not working in this case.

我还检查了此屏幕是否有任何现有的工作流程,但没有.

I have also checked if this screen has any existing workflows and it doesn't.

任何帮助将不胜感激.

谢谢.

推荐答案

除了编写代码在 RowSelected 事件中启用该字段外,在 Workflow 中添加处于 Closed 状态的字段也很重要.

Besides writing code to enable the field in RowSelected event, it is also important to add the field in Closed state in the Workflow.

但是,如果这也不起作用,删除项目的 CstDesigner 的内容就可以了.

However, if this is also not working deleting contents of CstDesigner of project does the job.

这篇关于无法在案例中启用自定义字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆