0

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

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

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

4

3 回答 3

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()
    {
    }
    
  2. 为 BLC 声明构造函数并将 Approve 和 Reject 操作添加为 ActionsMenu 的下拉项,如下所示:

    public TaskTemplateMaint()
    {
        ActionsMenu.AddMenuAction(Approve);
        ActionsMenu.AddMenuAction(Reject);
        ActionsMenu.MenuAutoOpen = true;
    }
    
于 2014-08-14T00:03:25.770 回答
0

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.

于 2015-03-20T15:40:14.720 回答
0

您好我不知道您使用的是哪种自定义技术,但您不需要修改 aspx 页面。只需使用以下代码

public YourConstructor()
{
    action.Add(yourAction);
}
于 2014-08-13T04:54:21.400 回答