【发布时间】:2017-05-20 06:50:23
【问题描述】:
我有一个关于账单和调整的自定义下拉字段,我想确定何时禁用屏幕上的特定字段。我正在使用以下逻辑,这似乎不起作用(注释行也不起作用)。我已经在用户字段上将 commitchanges 设置为 true - 我已经逐步检查了代码以确保它被命中:
protected virtual void APInvoice_UsrPOStatus_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
{
var apr = (APRegister)e.Row;
if (apr == null) return;
var aprext = PXCache<APRegister>.GetExtension<APRegisterExt>(apr);
if (aprext == null) return;
if (aprext.UsrPOstatus != "Open")
{
PXUIFieldAttribute.SetEnabled<APRegister.docType>(sender, apr, false);
PXUIFieldAttribute.SetEnabled<APRegister.refNbr>(sender, apr, false);
//PXUIFieldAttribute.SetEnabled<APInvoice.docType>(Base.Document.Cache, null, false); //(OpenSourceDataDetail.Cache, null, true);
//PXUIFieldAttribute.SetEnabled<APInvoice.refNbr>(Base.Document.Cache, null, false);
}
}
我没有收到任何错误,但没有任何反应。不能禁用这些字段吗?
我也不确定这些语句是使用 APInvoice 还是 APRegister。
【问题讨论】:
-
AInvoice 继承自 APRegister。我会去 APInvoice 遵循基本图并避免类型转换。
标签: acumatica