Acumatica - 将附加按钮添加到操作下拉到屏幕 CT30100

Joh*_*rds 0 erp acumatica

我正在尝试在 Acumatica ERP 屏幕 CT301000 操作下拉菜单中添加一个按钮,我已将按钮添加到图表中并修改了 aspx 以在其中包含以下内容PXDatasource=>CallbackCommands

px:PXDSCallbackCommand Name="TerminateRevenue" Visible="false" CommitChanges="True"
Run Code Online (Sandbox Code Playgroud)

但是我不确定如何将按钮添加到 Actions 集合中。有没有人有任何想法?提前致谢。

Rus*_*Dev 5

要创建下拉按钮,您应该完成以下步骤:

  1. 在 TaskTemplateMaint BLC 中声明以下操作,如下所示:

    public PXAction<TaskTemplate> Approve;
    [PXButton]
    [PXUIField(DisplayName = "Approve")]
    protected virtual void approve()
    {
        TaskTemplate template = Templates.Current;
        template.IsApproved = true;
        Templates.Update(template);
    }
    
    public PXAction<TaskTemplate> Reject;
    [PXButton]
    [PXUIField(DisplayName = "Reject")]
    protected virtual void reject()
    {
        TaskTemplate template = Templates.Current;
        template.IsRejected = true;
        Templates.Update(template);
    }
    
    public PXAction<TaskTemplate> ActionsMenu;
    [PXButton]
    [PXUIField(DisplayName = "Actions")]
    protected virtual void actionsMenu()
    {
    }
    
    Run Code Online (Sandbox Code Playgroud)
  2. 声明 BLC 的构造函数并添加 Approve 和 Reject 操作作为 ActionsMenu 的下拉项,如下所示:

    public TaskTemplateMaint()
    {
        ActionsMenu.AddMenuAction(Approve);
        ActionsMenu.AddMenuAction(Reject);
        ActionsMenu.MenuAutoOpen = true;
    }
    
    Run Code Online (Sandbox Code Playgroud)