有人可以为我提供一个关于如何通过 API 输入 PI Count 的示例。我使用了以下代码,该代码在开始时运行良好,但我无法输入项目/位置组合的计数,该组合未出现在直接从 Acumatica 发布的初始 PI 计数列表中。
IN305010Content IN305010 = oScreen.IN305010GetSchema();
oScreen.IN305010Clear();
List<Command> oCmds = new List<Command>();
oCmds.Clear();
oCmds.Add(new Key { Value = StocktakeRef, FieldName = IN305010.DocumentSummary.ReferenceNbr.FieldName, ObjectName = IN305010.DocumentSummary.ReferenceNbr.ObjectName, Commit = true });
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
oCmds.Add(new Key { Value = "='" + ds.Tables[0].Rows[i].ItemArray[2].ToString() + "'", FieldName = IN305010.PhysicalInventoryDetails.InventoryID.FieldName, ObjectName = IN305010.PhysicalInventoryDetails.InventoryID.ObjectName });
oCmds.Add(new Value { Value = "='" + ds.Tables[0].Rows[i].ItemArray[5].ToString() + "'", FieldName = IN305010.PhysicalInventoryDetails.Location.FieldName, ObjectName = IN305010.PhysicalInventoryDetails.Location.ObjectName, Commit = true });
oCmds.Add(new Value { Value = ds.Tables[0].Rows[i].ItemArray[3].ToString(), LinkedCommand = IN305010.PhysicalInventoryDetails.PhysicalQuantity, Commit = true});
}
oCmds.Add(IN305010.Actions.Save);
oScreen.IN305010Submit(oCmds.ToArray());
谢谢,G