如何在“处理装运”屏幕中添加动作和处理程序? [英] How to add an action and handler to the Process Shipments screen?

查看:69
本文介绍了如何在“处理装运”屏幕中添加动作和处理程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在处理装运屏幕中添加动作和处理程序?我们想在屏幕SO503000上的动作组合框中添加一个动作,然后在代码中添加一个处理程序以处理新动作。我们希望这样做而不必覆盖SOShipmentEntry图中Action的大switch / case语句。

How do I add an action and handler to the Process Shipments screen? We want to add an action to the Action combobox on screen SO503000, and then add a handler in code to process the new action. We want to do this without having to override the huge switch/case statement for Action in the SOShipmentEntry graph.

推荐答案

PXAutomationMenu属性从自动化步骤中拉出所有操作,这些操作具有设置为大量处理屏幕的适当处理屏幕:

The PXAutomationMenu attribute pulls from Automation Steps all actions, which have appropriate processing screen set up as Mass Processing Screen:

扩展列表在处理装运屏幕上可用的操作中,请按以下步骤操作:

To extend the list of actions available on the Process Shipments screen, please proceed as follows:


  1. 在BLC扩展中声明自定义操作并调用AddMenuAction方法在BLC初始化期间将其添加为操作按钮的下拉项

  1. Declare custom action within a BLC extension and invoke AddMenuAction method during BLC initialization to add it as a drop-down item for the Actions button

要将自定义操作添加到流程装运屏幕,请向适当的自动化添加自定义操作步骤并指定批量处理屏幕ID。当用户选择您的自定义动作时,包含该自定义动作的所有自动化步骤中的发件将在处理发件屏幕上可供选择:

To add custom action to the Process Shipments screen, add custom actions to appropriate automation step(s) and specify Mass Processing Screen ID. When user selects your custom action, Shipments from all Automations Steps, that contain a custom action, will be available for selection on the Process Shipments screen:

为SOShipmentEntry BLC声明的两个扩展名(相同的第一级),如下面的代码片段所示,可用于扩展Actions下拉菜单-向下进行多个自定义项目(两个彼此独立的自定义程序包;一个或两个都可以在特定站点上发布。并且这两个都可以在Process Shipments屏幕上添加操作):
要解决此情况,请:

Two extensions (of the same 1st level) declared for the SOShipmentEntry BLC, as shown in the code snippet below, can be used to extend Actions drop-down with multiple customization projects (two customization packages that are independent of each other; either one or both may be published on a particular site. And both add an action to the Process Shipments screen): To address this scenario, :

public class SOShipmentEntryExt1 : PXGraphExtension<SOShipmentEntry>
{
    public PXAction<SOShipment> Test1;
    [PXButton]
    [PXUIField(DisplayName = "Test Action 1")]
    protected void test1()
    {
        throw new PXException("Not implemented action: {0}", "Test Action 1");
    }

    public override void Initialize()
    {
        Base.action.AddMenuAction(Test1);
    }
}

public class SOShipmentEntryExt2 : PXGraphExtension<SOShipmentEntry>
{
    public PXAction<SOShipment> Test2;
    [PXButton]
    [PXUIField(DisplayName = "Test Action 2")]
    protected void test2()
    {
        throw new PXException("Not implemented action: {0}", "Test Action 2");
    }

    public override void Initialize()
    {
        Base.action.AddMenuAction(Test2);
    }
}

这篇关于如何在“处理装运”屏幕中添加动作和处理程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆