任何人都可以通过在 Acumatica(版本 4 或更高版本)中添加销售订单来帮助我创建货件。我尝试了以下代码但没有成功:
SO302000Content SO302000 = context.SO302000GetSchema();
context.SO302000Clear();
Command[] commands = new Command[] {
new Value { Value = "ABCSTUDIOS", LinkedCommand = SO302000.ShipmentSummary.Customer },
new Value { Value = "09/01/2015", LinkedCommand = SO302000.ShipmentSummary.ShipmentDate },
new Value { Value = "MAIN", LinkedCommand = SO302000.ShipmentSummary.Location },
new Value { Value = "RESALE", LinkedCommand = SO302000.ShipmentSummary.WarehouseID },
new Value { Value = "SO", LinkedCommand = SO302000.AddSalesOrderOperation.OrderType },
new Value { Value = "000211", LinkedCommand = SO302000.AddSalesOrderOperation.OrderNbr },
SO302000.AddSalesOrder.InventoryID,
SO302000.AddSalesOrder.Location,
SO302000.AddSalesOrder.OpenQty,
SO302000.AddSalesOrder.OrderQty
};
var results = context.SO302000Submit(commands);
if (results != null && results.Length > 0)
{
int line = 0;
List<Command> cmds = new List<Command>();
foreach (var row in results)
{
cmds.Add(new Value {
Value = line.ToString(),
LinkedCommand = SO302000.AddSalesOrder.ServiceCommands.RowNumber }
);
cmds.Add(new Value {
Value = "True",
LinkedCommand = SO302000.AddSalesOrder.Selected,
Commit = true }
);
line++;
}
cmds.Add(SO302000.Actions.AddSO);
context.SO302000Submit(cmds.ToArray());
cmds.Clear();
cmds.Add(SO302000.Actions.Save);
cmds.Add(SO302000.Actions.ActionConfirmShipment);
results = context.SO302000Submit(cmds.ToArray());
}
结果是来自 Acumatica 的错误,如下所述:
System.Web.Services.Protocols.SoapException:服务器无法处理请求。---> PX.Data.PXException:错误 #97:视图添加过滤器不存在。在 c:\Builders\4_10-2013_12_2-4_0_9-Auto\Scripts\BuildTemp\NetTools\PX.Data\Graph\Collection.cs: PX.Api.SyImportProcessor 的 PX.Data.PXViewCollection.get_Item(String key) 中的 PX.Data.PXViewCollection.get_Item(String key) .SyStep.SelectRows(String viewName, PXFilterRow[] filters, Int32 topCount, Boolean bypassInserted) 在 c:\Builders\4_10-2013_12_2-4_0_9-Auto\Scripts\BuildTemp\NetTools\PX.Data\Api\Export\SyImport\ImportProcessor c:\Builders\4_10-2013_12_2-4_0_9-Auto\Scripts\BuildTemp 中 PX.Api.SyImportProcessor.ExportTableHelper.a(SyStep A_0,GrowingTable A_1,SyCommand A_2,PXFilterRow[] A_3,Int32 A_4)的第 2521 行\NetTools\PX.Data\Api\Export\SyImport\ImportProcessor.cs:PX.Api.SyImportProcessor 的第 1212 行。
谢谢,G