Acumatica - Add additional buttons to Actions drop

2019-06-09 15:07发布

I am trying to add a button to the Acumatica ERP screen CT301000 Actions drop down, I have added the button to the graph and modified the aspx to include the following in the PXDatasource=>CallbackCommands:

px:PXDSCallbackCommand Name="TerminateRevenue" Visible="false" CommitChanges="True"

However I am unsure how to add the the button into the Actions collection. does anyone have any ideas? Thanks in advance.

标签: erp acumatica
3条回答
姐就是有狂的资本
2楼-- · 2019-06-09 15:33

To create a drop-down button, you should complete the following steps:

  1. Declare the following actions within the TaskTemplateMaint BLC as follows:

    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()
    {
    }
    
  2. Declare constructor for the BLC and add Approve and Reject actions as drop-down items for ActionsMenu as follows:

    public TaskTemplateMaint()
    {
        ActionsMenu.AddMenuAction(Approve);
        ActionsMenu.AddMenuAction(Reject);
        ActionsMenu.MenuAutoOpen = true;
    }
    
查看更多
Ridiculous、
3楼-- · 2019-06-09 15:39

The CT301000 screen uses the ContractMaint BLC

You can create an extension as follows in visual studio and reference the resulting dll in the web site to show the button.

public class ContractMaintExtension : PXGraphExtension<ContractMaint>
{
    public PXSelect<Contract> pCenters;

    public PXAction<Contract> DoSomething;
    [PXButton]
    [PXUIField(DisplayName = "My Button")]
    protected void doSomething()
    {
        //do actions 
    }



}

this creates the button and will automatically cause it to be displayed.

查看更多
劫难
4楼-- · 2019-06-09 15:45

Hi I don't know which customization technique you're using, but you don't need to modify aspx page. Just use the following codes

public YourConstructor()
{
    action.Add(yourAction);
}
查看更多
登录 后发表回答