简体   繁体   English

向 Acumatica 客户表单添加自定义操作菜单

[英]Adding custom action menu to Acumatica Customer form

I think this is probably just something stupid, but I'm trying to add a custom menu to the Customer form.我认为这可能只是一些愚蠢的事情,但我正在尝试向客户表单添加自定义菜单。 I've used this code:我用过这个代码:

    public override void Initialize()
    {
        base.Initialize();
        this.SpeedyActions.AddMenuAction(BtnCreateMenu1);
        this.SpeedyActions.AddMenuAction(BtnCreateMenu2);
    }

    public PXAction<PX.Objects.AR.Customer> BtnCreateMenu1;
    [PXButton(CommitChanges = true)]
    [PXUIField(DisplayName = "Menu Item 1")]
    protected void btnCreateMenu1()
    {

      // Logic

    }

    public PXAction<PX.Objects.AR.Customer> BtnCreateMenu2;
    [PXButton(CommitChanges = true)]
    [PXUIField(DisplayName = "Menu Item 2")]
    protected void btnCreateMenu2()
    {

      // Logic

    }      

    public PXAction<PX.Objects.AR.Customer> SpeedyActions;
    [PXButton(SpecialType = PXSpecialButtonType.Report, MenuAutoOpen =true)]
    [PXUIField(DisplayName = "Speedy Actions")]
    protected void speedyActions()
    {
       //code logic here
    }

I've got basically the same code on the sales order form and it works perfectly.我在销售订单上有基本相同的代码,它运行良好。 I suspect that I'm maybe using the wrong code here PX.Objects.AR.Customer and I've also tried CR.BAccount, but can't seem to make it work.我怀疑我可能在这里使用了错误的代码PX.Objects.AR.Customer并且我也尝试过 CR.BAccount,但似乎无法使其工作。 Anyone have some thoughts?有人有一些想法吗?

I would try我会尝试

Base.report.AddMenuAction(BtnCreateMenu1) Base.report.AddMenuAction(BtnCreateMenu1)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM