【问题标题】:error AR303000Submit use php - Api Acumatica ERPerror AR303000Submit use php - Api Acumatica ERP
【发布时间】:2016-02-13 09:09:52
【问题描述】:

我正在连接 Acumatica 的 api。目前,我使用 AR303000Submit 功能。但它返回错误

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#,还可以

【问题讨论】:

    标签: c# php api erp acumatica


    【解决方案1】:

    这是一般错误,您的代码似乎有问题。

    请关注旧文章 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 大学的一般帮助和信息,那里有培训指南。

    【讨论】:

    • 感谢 srodiovo,我尝试了一下,但在 #3(文章的 srodionov)出现了一些错误 System.Web.Services.Protocols.SoapException:服务器无法处理请求。 ---> System.ArgumentNullException: 值不能为空。\n参数名称:来源\n 位于 System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 来源)\n 位于 PX.Api.Soap.Screen.ScreenGate。提交(Command[] commands)\n --- 内部异常堆栈跟踪结束 ---
    • 你有方法吗?
    • 对不起,经过检查,它运行正确。谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多