【问题标题】:Customer Action "Extend To Vendor"客户行动“扩展到供应商”
【发布时间】:2015-04-21 22:34:25
【问题描述】:

使用最新版本的 Acumatica 5 和最新最好的更新,我遇到了一个我无法解决的 Web API 问题。我有代码可以在客户屏幕上执行“扩展到供应商”操作。它似乎运行良好并且不会出错,但无法创建供应商。在我看来,当通过网站界面执行相同的操作时,问题是我没有发送正确的命令来选择弹出警告框上的“是”按钮“请确认您是否要更新当前的供应商设置使用供应商类默认值。否则将保留原始设置。”不过我可以完全离开,任何帮助将不胜感激。

这是我的代码:

String customerId = "SomeCustomerId";
String vendorClass = “SomeVendorClass”;

AcumaticaApiWS.AR303000Content AR303000 = context.AR303000GetSchema();
AcumaticaApiWS.AP303000Content AP303000 = context.AP303000GetSchema();

context.AR303000Clear();
AR303000.Actions.ExtendToVendor.Commit = true;

AcumaticaApiWS.AR303000Content[] AR303000result = context.AR303000Submit
(
    new AcumaticaApiWS.Command[]
    {
        new AcumaticaApiWS.Value { Value = customerId, LinkedCommand = AR303000.CustomerSummary.CustomerID },
        AR303000.Actions.ExtendToVendor
    }   
);

AcumaticaApiWS.AP303000Content[] AP303000result = context.AP303000Submit
(
    new AcumaticaApiWS.Command[]
    {
        new AcumaticaApiWS.Value { Value = vendorClass, LinkedCommand = AP303000.GeneralInfoFinancialSettings.VendorClass },
        new AcumaticaApiWS.Value { Value = "YES", LinkedCommand = AP303000.GeneralInfoFinancialSettings.ServiceCommands.DialogAnswer, Commit = true },
        AP303000.Actions.Save
    }
);

谢谢!

【问题讨论】:

    标签: acumatica


    【解决方案1】:

    你快到了。这不是一个简单的场景,因为它涉及多个屏幕和对话框,这两件事并不容易使用。您的代码示例中的问题是:

    • 对话答案必须设置在之前的值。在您的情况下,您首先设置供应商类。这是违反直觉的,但系统必须在显示对话框之前知道它
    • 对话答案是“是”,而不是“是”。您可以通过使用 Web 浏览器检查器窗口并查看按钮标题来看到这一点。由于 CSS 样式,文本以大写显示。
    • 您需要在显示对话框的表单主视图 (AP303000.VendorSummary.ServiceCommands.DialogAnswer) 上设置对话框答案。不查看源代码就无法知道这一点,但我相信对话框通常是这种情况。
    • 不同的Commit = true 设置不是必需的(但在这种情况下不会造成伤害)。

    这是我使用的代码,在我的例子中,它将客户扩展到供应商并同时更改供应商类:

    String customerId = "ACTIVESTAF";
    String vendorClass = "DATACENTER";
    
    AcumaticaApiWS.AR303000Content AR303000 = context.AR303000GetSchema();
    AcumaticaApiWS.AP303000Content AP303000 = context.AP303000GetSchema();
    
    context.AR303000Clear();
    
    AcumaticaApiWS.AR303000Content[] AR303000result = context.AR303000Submit
    (
        new AcumaticaApiWS.Command[]
        {
            new AcumaticaApiWS.Value { Value = customerId, LinkedCommand = AR303000.CustomerSummary.CustomerID },
            AR303000.Actions.ExtendToVendor
        }
    );
    
    AcumaticaApiWS.AP303000Content[] AP303000result = context.AP303000Submit
    (
        new AcumaticaApiWS.Command[]
        {
            new AcumaticaApiWS.Value { Value = "Yes", LinkedCommand = AP303000.VendorSummary.ServiceCommands.DialogAnswer },
            new AcumaticaApiWS.Value { Value = vendorClass, LinkedCommand = AP303000.GeneralInfoFinancialSettings.VendorClass },
            AP303000.Actions.Save
        }
    );
    

    【讨论】:

    • @YuraZaletskyy 你是什么意思?这应该包含在 T900 中吗?
    • T900 ACUMATICA 网络服务。我的意思是如果出现弹出窗口,如何对案例进行导入/导出操作。
    • @YuraZaletskyy 我们目前正在重做网络服务培训,将分享。
    猜你喜欢
    • 1970-01-01
    • 2019-02-18
    • 1970-01-01
    • 2017-05-05
    • 2021-12-26
    • 2022-06-11
    • 2018-03-29
    • 2021-07-15
    • 1970-01-01
    相关资源
    最近更新 更多