Acumatica &引用;项目不能为空";在发票和备忘录屏幕中
我们需要使外部价格即使在发票发布后也可编辑,我们编写了使字段可编辑的逻辑,但当我们更新值时,我们得到的是“项目不能为空错误”。我们正在使用Acumatica 2020 R2 Build-20.207.0012和销售演示数据库,没有任何定制 下面是一个代码示例:Acumatica &引用;项目不能为空";在发票和备忘录屏幕中,acumatica,Acumatica,我们需要使外部价格即使在发票发布后也可编辑,我们编写了使字段可编辑的逻辑,但当我们更新值时,我们得到的是“项目不能为空错误”。我们正在使用Acumatica 2020 R2 Build-20.207.0012和销售演示数据库,没有任何定制 下面是一个代码示例: private bool IsDisabled(ARInvoice doc) { return doc.Released == true || doc.Void
private bool IsDisabled(ARInvoice doc)
{
return doc.Released == true
|| doc.Voided == true
|| doc.DocType == ARDocType.SmallCreditWO
|| doc.PendingPPD == true
|| doc.DocType == ARDocType.FinCharge
&& !Base.IsProcessingMode
&& Base.Document.Cache.GetStatus(doc) == PXEntryStatus.Inserted;
}
protected void ARInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
if(InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var rows= (ARInvoice)e.Row;
if (rows == null)
return;
if (IsDisabled(rows))
{
PXUIFieldAttribute.SetEnabled<ARTran.curyExtPrice>(cache, rows, true);
Base.Document.Cache.AllowUpdate = true;
Base.Transactions.Cache.AllowUpdate = true;
}
}
我认为最好的办法是将该字段添加到屏幕中,并检查其值: 然后还可以尝试抑制以下错误:
namespace PX.Objects.SO
{
public class SOInvoiceEntry_Extension : PXGraphExtension<SOInvoiceEntry>
{
#region Event Handlers
protected void ARTran_ProjectID_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
{
e.Cancel = true;
}
#endregion
}
}
名称空间PX.Objects.SO
{
公共类SOInvoiceEntry_扩展名:pxGrapherExtension
{
#区域事件处理程序
受保护的void ARTran_projectd_fieldVerification(PXCache缓存、PXFieldVerifyingEventArgs e)
{
e、 取消=真;
}
#端区
}
}
是否为PXUIFieldAttribute.SetEnabled(缓存、行、true);这是给我们看不到的问题或代码?嗨,JvD,你是对的,这行代码抛出了错误,我们还使一些标题字段可编辑,但正如我所说的,当我们使行级字段可编辑时,我们得到了这个问题。感谢输入JvD,我们将检查它并让你知道。
namespace PX.Objects.SO
{
public class SOInvoiceEntry_Extension : PXGraphExtension<SOInvoiceEntry>
{
#region Event Handlers
protected void ARTran_ProjectID_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
{
e.Cancel = true;
}
#endregion
}
}