2015-11-12 26 views
0

我連接Acumatica的API。目前,我使用AR303000Submit功能。但它返回錯誤錯誤AR303000Submit使用PHP - Api Acumatica ERP

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 = "[email protected]"; 
     $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 ---

我不知道我是misstake。 PS:我嘗試C#,它可以

回答

0

這是一般錯誤,看起來像你的代碼有問題。

請按照舊文章 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大學看看一般的幫助和信息有培訓quide。

+0

謝謝srodiovo,我試了一下,但在#3(文章srodionov)System.Web.Services.Protocols.SoapException:一些錯誤:服務器無法處理請求。 ---> System.ArgumentNullException:值不能爲空。\ n在PX.Api.Soap.Screen.ScreenGate處的System.Linq.Enumerable.ToArray [TSource](IEnumerable'1 source)\ n處的參數名稱:source \ n。提交(Command []命令)\ n ---內部異常堆棧跟蹤結束--- –

+0

您有方法嗎? –

+0

對不起,檢查後,它運行正常。謝謝 –