Acumatica - 页面中 AlloAddNew 上的 NonStockItem 屏幕 [英] Acumatica - NonStockItem Screen on AlloAddNew in Page
问题描述
美好的一天!
我在 DAC 中有一个 PXSelector 字段,它只显示非库存商品
I have a PXSelector field in DAC that only show non-stock items
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; }
我的页面中还有一个允许编辑和添加新方法的选择器
I also have a selector in my page that allows edit and allows add new methods
<px:PXSelector ID="edInventoryID" runat="server" DataField="InventoryID" AllowEdit="true" AllowAddNew="true">
</px:PXSelector>
现在,我的问题在于用户界面中的编辑(铅笔)按钮.当我点击编辑按钮时,我想编辑的项目,我被重定向到非库存项目页面,
Now, my problem lies with the edit(pencil) button in the User Interface. When I'm clicking the edit button, with the item that i want to edit, I am being redirected to Non-Stock Items page,
但是当我想使用编辑(铅笔)按钮添加另一个非库存项目时,我被重定向到库存项目页面.
But when I want to add another Non-stock Item by using the edit(pencil) button, I am redirected to the Stock Items page.
我已经设置了我的 PrimaryGraph.
I already set my PrimaryGraph.
[PXPrimaryGraph(typeof(PropertyMaint))]
public class RECOInventoryItem : Audit, IBqlTable
如何将 AllowAddNew 重定向设置为非库存项目页面而不是库存项目页面.
How do you set the AllowAddNew redirect to Non-Stock Item Page instead of the Stock Item Page.
如何覆盖 InventoryItem 的 PxPrimaryGraph,以便我重定向到的图形是非库存项目,而不是库存项目.
How do you override the PxPrimaryGraph of the InventoryItem so that the graph that i'm redirecting to is Non-stock Item, instead of Stock Item.
非常感谢您的意见和建议.
Thank you so much for the advice and suggestions.
推荐答案
PXPrimaryGraph
可以使用 DAC 字段上的 BQL 条件将 1 个 DAC 绑定到多个图形,如 InventoryItem DAC 所示:
PXPrimaryGraph
can handle binding 1 DAC to multiple graphs using BQL conditions on the DAC fields as shown on 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
字段已填充在您要编辑的记录中.
This works well with AllowEdit
functionality because the InventoryItem.stkItem
field used for the graph redirection is already populated in the record you want to edit.
当您使用 AllowAddNew
创建新记录时,尽管我怀疑 InventoryItem.stkItem
字段将为空或始终默认为 PXDefault的相同值代码>属性.这会产生总是重定向到同一个图的副作用.
When you create a new record with AllowAddNew
though I suspect the field InventoryItem.stkItem
will be null or always defaulted to the same value by PXDefault
attribute. This would have the side effect of always redirecting to the same graph.
正如您可能猜到的那样,AllowAddNew
没有任何选项或编程接口来影响它的行为,因此它的功能非常有限.出于这个原因,我认为你不能覆盖它的行为.
As you can probably guess AllowAddNew
doesn't have any options or programmatic interface to influence it's behavior so it is pretty limited in what it can do. For that reason I don't think you can override it's behavior.
这将创建您自己的操作按钮作为我知道实现您的用例的唯一选项.您可以设置按钮样式以显示 +
图标,而不是像 AllowAddNew 那样的文本.由于 Selector
弹出窗口也缺少选项和编程界面,因此您仍然会限制可以放置该按钮的位置.
This leave creating your own action button as the only option I know to achieve your use case. You can style the button to show a +
icon and no text like AllowAddNew does. You would still be limited on where you can place that button because Selector
popup windows also lack options and programmatic interface.
这篇关于Acumatica - 页面中 AlloAddNew 上的 NonStockItem 屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!