0

有人可以为我提供一个关于如何通过 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

4

2 回答 2

0

我没有遵循您的代码,实际上不知道它应该做什么。但是我看到你需要调用弹出窗口,我没有该屏幕的确切示例,但我会提供类似的。

另外,请关注我们的旧论坛,在那里您可以找到一些有用的东西。

http://forum.acumatica.com/forum/acumatica-reseller-and-isv-community/development-and-customization/844-t210-acumatica-web-services-basic?p=3003#post3003

SO301000result = context.SO301000Submit(
            new Command[] 
            {                                                         
                new Value { Value = "SO", LinkedCommand = SO301000.OrderSummary.OrderType },
                new Value { Value = ordNum, LinkedCommand = SO301000.OrderSummary.OrderNbr },

                //popup window                                           
                new Value { Value = "OK", LinkedCommand = SO301000.InventoryLookup.ServiceCommands.DialogAnswer, Commit = true },
                new Value { Value = "OK", LinkedCommand = SO301000.InventoryLookupInventory.ServiceCommands.DialogAnswer, Commit = true },
                new Value { Value = "RETAIL", LinkedCommand = SO301000.InventoryLookupInventory.SiteID },
                new Value { Value = "CPU000", LinkedCommand = SO301000.InventoryLookupInventory.Inventory, Commit = true  },

                new Key { Value = "='CPU00004'", FieldName = SO301000.InventoryLookup.InventoryCD.FieldName, ObjectName = SO301000.InventoryLookup.InventoryCD.ObjectName },
                new Value { Value = "True", LinkedCommand = SO301000.InventoryLookup.Selected, Commit = true },

                SO301000.Actions.Save
            }
        );
于 2015-03-03T16:49:44.393 回答
0

如果有人需要,这是解决我的问题的代码

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 });
oCmds.Add(new Value { Value = "OK", LinkedCommand = IN305010.AddLine.ServiceCommands.DialogAnswer, Commit = true });
oCmds.Add(new Value { Value = "True" , FieldName = IN305010.AddLine.AutoAddLine.FieldName, ObjectName = IN305010.AddLine.AutoAddLine.ObjectName, Commit = true });

for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
  oCmds.Add(new Value { Value = "OK", LinkedCommand = IN305010.AddLine.ServiceCommands.DialogAnswer, Commit = true });
  oCmds.Add(new Value { Value = <<"Qty">>, FieldName = IN305010.AddLine.Qty.FieldName, ObjectName = IN305010.AddLine.Qty.ObjectName });
  oCmds.Add(new Value { Value = <<"Item">>, FieldName = IN305010.AddLine.InventoryID.FieldName, ObjectName = IN305010.AddLine.InventoryID.ObjectName, Commit = true });
  oCmds.Add(new Value { Value = <<"Location">>, FieldName = IN305010.AddLine.LocationID.FieldName, ObjectName = IN305010.AddLine.LocationID.ObjectName, Commit = true });
  oCmds.Add(new Value { Value = "True", LinkedCommand = IN305010.Actions.AddLine2, Commit = true });
}
oCmds.Add(IN305010.Actions.Save);
oScreen.IN305010Submit(oCmds.ToArray());

干杯,G

于 2015-07-14T03:03:21.877 回答