我已经在“销售订单”屏幕中的“操作”下创建了一个自定义操作菜单项,当我单击“自定义”按钮时,它将创建一张发票并在新选项卡中打开新创建的发票,问题是当我单击“自定义”按钮而没有保存销售订单文档后,该销售订单不会在其原始选项卡中显示当前订单。请看下面的代码,让我知道这里做错了什么。
public PXAction<SOOrder> MyAction;
[PXUIField(DisplayName = "MyAction", MapViewRights = PXCacheRights.Select, MapEnableRights = PXCacheRights.Update)]
[PXButton]
public virtual IEnumerable myAction(PXAdapter adapter)
{
Base.Save.Press();
PXLongOperation.StartOperation(Base, delegate ()
{
using (PXTransactionScope ts = new PXTransactionScope())
{
//my code
// here am creating invoice and showing newly created invoice in new tab.
}
});
return adapter.Get();
}