Acumatica - Add additional buttons to Actions drop down to screen CT30100

本秂侑毒 提交于 2019-12-10 11:56:51

问题


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.


回答1:



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);
}



回答2:


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;
    }
    



回答3:


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.



来源:https://stackoverflow.com/questions/25270909/acumatica-add-additional-buttons-to-actions-drop-down-to-screen-ct30100

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!