首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >流程屏幕上的自定义打印发票操作

流程屏幕上的自定义打印发票操作
EN

Stack Overflow用户
提问于 2018-08-31 22:14:52
回答 1查看 106关注 0票数 0

我正在尝试在我的新流程屏幕上有一个打印发票操作,它指向以Customer Ref Nbr为参数的新自定义报告。有什么关于如何开始的帮助吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-08-31 23:08:57

在Acumatica中,重定向到另一个页面(指向新的自定义报告)是通过抛出重定向异常来完成的。对于重定向到报告页面,您应该使用的异常是'PXReportRequiredException‘。

用于启动带有参数的自定义报表的代码:

代码语言:javascript
复制
    public PXAction<Customer> printInvoice;

    [PXUIField(DisplayName = "Print Invoice", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
    public virtual IEnumerable PrintInvoice(PXAdapter adapter)
    {
        Customer customer = [fetch desired customer record here];

        if (customer != null && customer.RefNbr != null)
        {
            // Add your report parameters to a Dictionary<string, string> collection.
            // The dictionary key is the parameter name as shown in the report editor.
            // The dictionary value is the value you assign to that parameter.
            Dictionary<string, string> parameters = new Dictionary<string, string>();
            parameters["RefNbr"] = customer.RefNbr;

            // Provide your custom report ReportID
            string reportID = "AR641000";

            // Provide a title name for your report page
            string reportName = "Customer Invoice"

            // Redirect to report page by throwing a PXReportRequiredException object 
            throw new PXReportRequiredException(parameters, reportID, reportName);
        }

        return adapter.Get();
    }

您可以在Acumatica Report Designer的Schema Builder对话框的Parameters选项卡中查找参数名称:

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52117362

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档