【问题标题】:Acumatica - NonStockItem Screen on AlloAddNew in PageAcumatica - 页面中 AlloAddNew 上的 NonStockItem 屏幕
【发布时间】:2019-01-30 16:50:22
【问题描述】:

美好的一天!

我在 DAC 中有一个仅显示非库存商品的 PXSelector 字段

    public abstract class inventoryID : IBqlField { }

    [PXDBInt]
    [PXSelector(typeof(Search2<InventoryItem.inventoryID,
                                LeftJoin<RECOInventoryItem, On<RECOInventoryItem.inventoryID, Equal<InventoryItem.inventoryID>>>,
                                Where<RECOInventoryItem.inventoryID, IsNull,
                                    And<InventoryItem.itemType, Equal<ItemType.NON_STOCK>,
                                        And<InventoryItem.stkItem, Equal<False>>>>>),
                          typeof(InventoryItem.inventoryCD),
                          typeof(InventoryItem.descr),
                          DescriptionField = typeof(InventoryItem.descr))]
    [PXUIField(DisplayName = "Inventory")]
    [PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
    public virtual int? InventoryID { get; set; }

我的页面中还有一个选择器,允许编辑和添加新方法

        <px:PXSelector ID="edInventoryID" runat="server" DataField="InventoryID" AllowEdit="true" AllowAddNew="true">
        </px:PXSelector>

现在,我的问题在于用户界面中的编辑(铅笔)按钮。当我点击编辑按钮时,我想要编辑的项目,我被重定向到非库存项目页面,

但是当我想使用编辑(铅笔)按钮添加另一个非库存商品时,我被重定向到库存商品页面。

我已经设置了我的 PrimaryGraph。

[PXPrimaryGraph(typeof(PropertyMaint))]
public class RECOInventoryItem : Audit, IBqlTable

如何将 AllowAddNew 重定向设置为非库存商品页面而不是库存商品页面。

如何覆盖 InventoryItem 的 PxPrimaryGraph,以便我重定向到的图表是非库存项目,而不是库存项目。

非常感谢您的意见和建议。

【问题讨论】:

    标签: acumatica


    【解决方案1】:

    PXPrimaryGraph 可以使用 DAC 字段上的 BQL 条件将 1 个 DAC 绑定到多个图表,如 InventoryItem DAC 所示:

    [PXPrimaryGraph(new Type[] 
                    {
                       typeof(NonStockItemMaint),
                       typeof(InventoryItemMaint)
                    },
                    new Type[] 
                    {
                       typeof(Where<InventoryItem.stkItem, Equal<False>>),
                       typeof(Where<InventoryItem.stkItem, Equal<True>>)
                    })] 
    

    这适用于AllowEdit 功能,因为用于图形重定向的InventoryItem.stkItem 字段已填充到您要编辑的记录中。

    当您使用AllowAddNew 创建新记录时,尽管我怀疑InventoryItem.stkItem 字段将为空或始终默认为PXDefault 属性的相同值。这会产生总是重定向到同一个图表的副作用。

    正如您可能猜到的那样,AllowAddNew 没有任何选项或编程接口来影响其行为,因此它的功能非常有限。出于这个原因,我认为你不能覆盖它的行为。

    这使得创建您自己的操作按钮成为我所知道的实现您的用例的唯一选择。您可以设置按钮的样式以显示+ 图标,并且没有像 AllowAddNew 那样的文本。由于Selector 弹出窗口也缺少选项和编程界面,因此您仍然可以放置该按钮的位置受到限制。

    【讨论】:

    • 您好,非常感谢,我现在大致了解需要做什么才能拥有我的非库存商品。
    猜你喜欢
    • 1970-01-01
    • 2018-02-16
    • 2018-11-22
    • 1970-01-01
    • 2021-10-09
    • 2021-12-14
    • 1970-01-01
    • 2018-11-29
    • 1970-01-01
    相关资源
    最近更新 更多