gpt4 book ai didi

acumatica - 发票和备忘录屏幕中的 "Project cannot be empty"

转载 作者:行者123 更新时间:2023-12-05 06:49:04 33 4
gpt4 key购买 nike

我们有要求做分机。即使在发票发布后价格仍可编辑,我们编写了使字段可编辑的逻辑,但是当我们更新值时,我们收到“项目不能为空错误”。我们使用的是 Acumatica 2020 R2 Build - 20.207.0012 和销售演示数据库,没有任何自定义。

这是一个代码示例:

   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;
}

}

跟踪:

3/16/2021 12:30:41 PM Error:
Error: Updating 'SO Invoice' record raised at least one error. Please review the errors.

Error: 'Project' cannot be empty.

at PX.Data.PXUIFieldAttribute.CommandPreparing(PXCache sender, PXCommandPreparingEventArgs e)
at PX.Data.PXCache.OnCommandPreparing(String name, Object row, Object value, PXDBOperation operation, Type table, FieldDescription& description)
at PX.Data.PXProjectionAttribute.PersistUpdated(PXCache sender, Object row)
at PX.Data.PXCache`1.PersistUpdated(Object row, Boolean bypassInterceptor)
at PX.Data.PXCache`1.Persist(PXDBOperation operation)
at PX.Data.PXGraph.Persist(Type cacheType, PXDBOperation operation)
at PX.Data.PXGraph.Persist()
at PX.Objects.AR.ARInvoiceEntry.Persist()
at PX.Objects.AR.ARInvoiceEntryExternalTax.Persist(Action persist)
at PX.Data.PXSave`1.d__2.MoveNext()
at PX.Data.PXAction`1.d__30.MoveNext()
at PX.Data.PXAction`1.d__30.MoveNext()
at PX.Web.UI.PXBaseDataSource.tryExecutePendingCommand(String viewName, String[] sortcolumns, Boolean[] descendings, Object[] searches, Object[] parameters, PXFilterRow[] filters, DataSourceSelectArguments arguments, Boolean& closeWindowRequired, Int32& adapterStartRow, Int32& adapterTotalRows)
at PX.Web.UI.PXBaseDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments

最佳答案

我认为最好的办法是将该字段添加到屏幕并检查其值: enter image description here

然后也可以这样尝试抑制错误:

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
}
}

关于acumatica - 发票和备忘录屏幕中的 "Project cannot be empty",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66655402/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com