Acumatica 如何在另一个选项卡中传递Artran行
我是来寻求帮助的 说明: 我正在尝试将发票行发送到另一个选项卡, 我有一张支票, 即,一个复选框 例如: 如果发票有两行, 您必须在另一个选项卡中传递这两行: 问题是他们只给我发了一行代码, 我会给他们看,我希望他们能帮助我,我找不到解决办法 我附上图片 1: 2:这是我的控制 3:字段更新结果 我正在处理这件事 “字段更新” 代码Acumatica 如何在另一个选项卡中传递Artran行,acumatica,acumatica-kb,Acumatica,Acumatica Kb,我是来寻求帮助的 说明: 我正在尝试将发票行发送到另一个选项卡, 我有一张支票, 即,一个复选框 例如: 如果发票有两行, 您必须在另一个选项卡中传递这两行: 问题是他们只给我发了一行代码, 我会给他们看,我希望他们能帮助我,我找不到解决办法 我附上图片 1: 2:这是我的控制 3:字段更新结果 我正在处理这件事 “字段更新” 代码 protectedvoid PEFEExternalTrade\u SendOther\u FieldUpdated(PXCache缓存,PXFieldUpd
protectedvoid PEFEExternalTrade\u SendOther\u FieldUpdated(PXCache缓存,PXFieldUpdatedEventArgs e)
{
PefeeExternalTrade val=(PefeeExternalTrade)e.Row;
如果(val!=null)
{
if(val.SendOther==true&&Sendanothertab.Current==null)
{
ARInvoice ari=Base.Document.Current;
如果(ari==null){return;}
val.DocType=ari.DocType;
val.RefNbr=ari.RefNbr;
ARRegister areg=PXSelect.Select(Base,val.RefNbr,val.DocType);
如果(arReg==null&&arReg.CuryID==null){return;}
Sendanothertab.Current=Sendanothertab.Insert();
Sendanothertab.Current.RefNbr=val.RefNbr;
Sendanothertab.Current.DocType=val.DocType;
foreach(base.base.Transactions.Select()中的PXResult项)
{
ARTran ARTran=项目;
if(PEFEHelper.IsStockItem(arTran.InventoryID,cache.Graph))
{
InventoryItem cod=PXSelect.Select(Base,arTran.InventoryID);
FELines.Current=FELines.Insert();
FELines.Cache.SetValueExt((对象)FELines.Current,(对象)arTran.TranType);
FELines.Cache.SetValueExt((对象)FELines.Current,(对象)arTran.RefNbr);
FELines.Cache.SetValueExt((对象)FELines.Current,(对象)arTran.LineNbr);
FELines.Cache.SetValueExt((对象)FELines.Current,(对象)arTran.InventoryID);
FELines.Cache.SetValueExt((对象)FELines.Current,(对象)cod.InventoryCD);
FELines.Cache.SetValueExt((对象)FELines.Current,(对象)arTran.Qty);
FELines.Cache.SetValueExt((对象)FELines.Current,(对象)arTran.CuryTranAmt);
FELines.Cache.SetValueExt((object)FELines.Current,(object)(!arReg.CuryID.Equals(“USD”)?calcusUnitamount(Cache,arTran.CuryUnitPrice,((val!=null)?val.EtCuryRate:null)??1m,(val!=null)?arReg CuryID:null):arTran.CuryUnitPrice));
}
}
Sendanothertab.Current.etusdtall=calcusdottal(FELines.Select());
}
}
}
Hi Tibu,我认为您可以复制该选项卡,并根据新选项卡的可见表达式进行隐藏和显示。检查iskey字段以确保这些键不会限制您的记录。此外,如果两个网格使用相同的DAC类型,则需要更新两个where语句以限制显示的记录。另一种尝试是插入。在插入之前设置键(例如:RefNbr和DocType字段,如果它们是键的话)谢谢各位,如果它起作用的话,我的逻辑做得很糟糕,但我仍然感谢你们对每一个字段的回复。
protected void PEFEExternalTrade_SendOther_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
PEFEExternalTrade val = (PEFEExternalTrade)e.Row;
if (val != null)
{
if (val.SendOther == true && Sendanothertab.Current == null)
{
ARInvoice ari = Base.Document.Current;
if (ari == null) { return; }
val.DocType = ari.DocType;
val.RefNbr = ari.RefNbr;
ARRegister arReg = PXSelect<ARRegister, Where<ARRegister.refNbr, Equal<Required<ARRegister.refNbr>>, And<ARRegister.docType, Equal<Required<ARRegister.docType>>>>>.Select(Base, val.RefNbr, val.DocType);
if (arReg == null && arReg.CuryID == null) { return; }
Sendanothertab.Current = Sendanothertab.Insert();
Sendanothertab.Current.RefNbr = val.RefNbr;
Sendanothertab.Current.DocType = val.DocType;
foreach (PXResult<ARTran> item in base.Base.Transactions.Select())
{
ARTran arTran = item;
if (PEFEHelper.IsStockItem(arTran.InventoryID, cache.Graph))
{
InventoryItem cod = PXSelect<InventoryItem, Where<InventoryItem.inventoryID, Equal<Required<InventoryItem.inventoryID>>>>.Select(Base, arTran.InventoryID);
FELines.Current = FELines.Insert();
FELines.Cache.SetValueExt<PEFEExtTradeLine.tranType>((object)FELines.Current, (object)arTran.TranType);
FELines.Cache.SetValueExt<PEFEExtTradeLine.refNbr>((object)FELines.Current, (object)arTran.RefNbr);
FELines.Cache.SetValueExt<PEFEExtTradeLine.lineNbr>((object)FELines.Current, (object)arTran.LineNbr);
FELines.Cache.SetValueExt<PEFEExtTradeLine.inventoryID>((object)FELines.Current, (object)arTran.InventoryID);
FELines.Cache.SetValueExt<PEFEExtTradeLine.identification>((object)FELines.Current, (object)cod.InventoryCD);
FELines.Cache.SetValueExt<PEFEExtTradeLine.qty>((object)FELines.Current, (object)arTran.Qty);
FELines.Cache.SetValueExt<PEFEExtTradeLine.totalAmt>((object)FELines.Current, (object)arTran.CuryTranAmt);
FELines.Cache.SetValueExt<PEFEExtTradeLine.unitPrice>((object)FELines.Current, (object)((!arReg.CuryID.Equals("USD")) ? CalcUSDUnitAmount(cache, arTran.CuryUnitPrice, ((val != null) ? val.EtCuryRate : null) ?? 1m, (val != null) ? arReg.CuryID : null) : arTran.CuryUnitPrice));
}
}
Sendanothertab.Current.EtUsdTotal = CalcUSDTotal(FELines.Select());
}
}
}