错误AR303000提交使用Api Acumatica ERP
本文关键字:Api Acumatica ERP AR303000 提交 错误 | 更新日期: 2023-09-27 18:21:32
我正在连接Acumatica的api。目前,我使用AR303000提交功能。但它返回错误
Error #102: View doesn't exist.
at PX.Data.PXViewCollection.get_Item(String key)
at PX.Api.SyImportProcessor.SyStep.FillSearches(String viewName, SyView view, List`1 srchs, List`1 sorts, List`1 descs)
at PX.Api.SyImportProcessor.SyStep.SelectRows(String viewName, PXFilterRow[] filters, Int32 topCount, Boolean bypassInserted, Int32 startRow, Dictionary`2 externalSorts)
at PX.Api.SyImportProcessor.ExportTableHelper.a(SyStep A_0, GrowingTable A_1, SyCommand A_2, PXFilterRow[] A_3, Int32 A_4)
at PX.Api.SyImportProcessor.ExportTableHelper.ExportTable()
at PX.Api.ScreenUtils.Submit(String screenId, Command[] commands, SchemaMode schemaMode, PXGraph& graph, String& redirectContainerView, String& redirectScreen, Boolean mobile, Dictionary`2 viewFilters)
at PX.Api.Services.ScreenService.Submit(String id, IEnumerable`1 commands, SchemaMode schemaMode, Boolean mobile, PXGraph& forceGraph, String& redirectContainerView, String& redirectScreen, Dictionary`2 viewFilters)
at PX.Api.Services.ScreenService.Submit(String id, IEnumerable`1 commands, SchemaMode schemaMode)
at PX.Api.Soap.Screen.ScreenGate.Submit(Command[] commands)
--- End of inner exception stack trace ---
我知道关于这个对象的一些问题很多,但这是旧的或不更新
我的代码
$AR303000GetSchema = $acumatica->client->AR303000GetSchema(new GetSchema());
$AR303000GetSchema = $AR303000GetSchema->GetSchemaResult;
$acumatica->client->AR303000Clear(new Clear());
$AR303000Submit = new Submit();
$AR303000Submit->commands = array
(
$acumatica->prepareValue("TEST123", $AR303000GetSchema->CustomerSummary->CustomerID),
$acumatica->prepareValue("TEST123", $AR303000GetSchema->CustomerSummary->CustomerName),
$acumatica->prepareValue('US', $AR303000GetSchema->GeneralInfoMainAddress->Country),
$AR303000GetSchema->Actions->Save
);
$submit_result = $acumatica->client->AR303000Submit($AR303000Submit);
帮帮我。谢谢
更新我试了一下http://forum.acumatica.com/forum/acumatica-reseller-and-isv-community/development-and-customization/740-api-how-to-create-api-project-and-use-it-with-c-php-java?q=php(#3)
$schema = $AR303000GetSchema;
$cmds = array();
$cmd = new Value();
$cmd->Value = "giahoang";
$cmd->LinkedCommand = $schema->CustomerSummary->CustomerID;
$soapvar = new 'SoapVar($cmd, SOAP_ENC_OBJECT, "Value", "http://www.acumatica.com/typed/");
array_push($cmds, $soapvar);
$cmd = new Value();
$cmd->Value = "giahoang";
$cmd->LinkedCommand = $schema->CustomerSummary->CustomerName;
$soapvar = new 'SoapVar($cmd, SOAP_ENC_OBJECT, "Value", "http://www.acumatica.com/typed/");
array_push($cmds, $soapvar);
$cmd = new Value();
$cmd->Value = "US";
$cmd->LinkedCommand = $schema->GeneralInfoMainAddress->Country;
$soapvar = new 'SoapVar($cmd, SOAP_ENC_OBJECT, "Value", "http://www.acumatica.com/typed/");
array_push($cmds, $soapvar);
$cmd = new Value();
$cmd->Value = "hoang@acumatica.com";
$cmd->LinkedCommand = $schema->GeneralInfoMainContact->Email;
$soapvar = new 'SoapVar($cmd, SOAP_ENC_OBJECT, "Value", "http://www.acumatica.com/typed/");
array_push($cmds, $soapvar);
$soapvar = new 'SoapVar($schema->Actions->Save, SOAP_ENC_OBJECT, "Action", "http://www.acumatica.com/typed/");
array_push($cmds, $soapvar);
$submit_result = $acumatica->client->AR303000Submit(array(array("commands" => $cmds)));
print_r($submit_result);
返回错误
System.Web.Services.Protocols.SoapException: Server was unable to process request. --->
System.ArgumentNullException: Value cannot be null.'nParameter name: source'n
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)'n
at PX.Api.Soap.Screen.ScreenGate.Submit(Command[] commands)'n
--- End of inner exception stack trace ---
我不知道我错了。PS:我尝试了C#,它可以
这是一个一般错误,看起来像是代码出了问题。
请按照旧文章http://forum.acumatica.com/forum/acumatica-reseller-and-isv-community/development-and-customization/740-api-how-to-create-api-project-and-use-it-with-c-php-java?q=php
你也可以看看Acumatica大学的一般帮助和信息,那里有培训技巧。