如何向“处理货件”屏幕添加操作和处理程序?
How to add an action and handler to the Process Shipments screen?
如何向“处理货件”屏幕添加操作和处理程序?我们想在屏幕 SO503000 上的 Action 组合框中添加一个动作,然后在代码中添加一个处理程序来处理新的动作。我们希望这样做而不必覆盖 SOShipmentEntry 图中巨大的 switch/case 动作语句。
PXAutomationMenu 属性从自动化步骤中提取所有操作,这些操作具有设置为批量处理屏幕的适当处理屏幕:
要扩展“处理货件”屏幕上的可用操作列表,请执行以下操作:
在 BLC 扩展中声明自定义操作并在 BLC 初始化期间调用 AddMenuAction 方法以将其添加为操作按钮的下拉项
要将自定义操作添加到处理装运屏幕,请将自定义操作添加到适当的自动化步骤并指定批量处理屏幕 ID。当用户选择您的自定义操作时,来自所有包含自定义操作的自动化步骤的发货将在“处理发货”屏幕上可供选择:
为 SOShipmentEntry BLC 声明的两个扩展(相同的第 1 级),如下面的代码片段所示,可用于扩展具有多个自定义项目的 Actions 下拉菜单(两个独立于每个项目的自定义包其他;其中一个或两个都可以发布在特定站点上。并且都向“处理货件”屏幕添加一个操作):
要解决这种情况,:
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);
}
}
如何向“处理货件”屏幕添加操作和处理程序?我们想在屏幕 SO503000 上的 Action 组合框中添加一个动作,然后在代码中添加一个处理程序来处理新的动作。我们希望这样做而不必覆盖 SOShipmentEntry 图中巨大的 switch/case 动作语句。
PXAutomationMenu 属性从自动化步骤中提取所有操作,这些操作具有设置为批量处理屏幕的适当处理屏幕:
要扩展“处理货件”屏幕上的可用操作列表,请执行以下操作:
在 BLC 扩展中声明自定义操作并在 BLC 初始化期间调用 AddMenuAction 方法以将其添加为操作按钮的下拉项
要将自定义操作添加到处理装运屏幕,请将自定义操作添加到适当的自动化步骤并指定批量处理屏幕 ID。当用户选择您的自定义操作时,来自所有包含自定义操作的自动化步骤的发货将在“处理发货”屏幕上可供选择:
为 SOShipmentEntry BLC 声明的两个扩展(相同的第 1 级),如下面的代码片段所示,可用于扩展具有多个自定义项目的 Actions 下拉菜单(两个独立于每个项目的自定义包其他;其中一个或两个都可以发布在特定站点上。并且都向“处理货件”屏幕添加一个操作): 要解决这种情况,:
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);
}
}