2017-08-10 58 views
0

在銷售訂單條目中,我添加了一個工具欄按鈕「套件詳細信息」。如何彈出屏幕以顯示當前所選工具箱項目的規格?顯示套件規格

kit details

+0

您是否嘗試過任何操作? – Hybridzz

+0

我假設你只是試圖打開套件頁面/圖形?查找調用PXRedirectHelper或PXRedirectRequiredException的示例 – Brendan

回答

0

如果你想打開KitAssembly在動作處理程序使用下面的代碼:

[PXButton] 
[PXUIField(DisplayName = "Kit Details", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Visible = true)] 
public virtual IEnumerable KitDetail(PXAdapter adapter) 
{ 
    // Add error handling if necessary 
    KitAssemblyEntry kitAssemblyEntry = PXGraph.CreateInstance<KitAssemblyEntry>(); 
    kitAssemblyEntry.Document.Current = kitAssemblyEntry.Document.Search<INKitRegister.inventoryID>(Base.Transactions.Current.InventoryID); 
    throw new PXRedirectRequiredException(kitAssemblyEntry, true, "IN Kit Assembly") { Mode = PXBaseRedirectException.WindowMode.NewWindow }; 
} 

當調用KitDetail行動: enter image description here

它會打開套件組裝爲選定的SOLine.InventoryID: enter image description here

編輯

是INKitSpecMaint是顯示試劑盒規格的正確圖表。 當搜索不起作用時,您可以使用Select來初始化新圖:

[PXProcessButton] 
[PXUIField(DisplayName = "Kit Details", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Visible = true)] 
public virtual IEnumerable KitDetail(PXAdapter adapter) 
{ 
    INKitSpecMaint kitSpecification = PXGraph.CreateInstance<INKitSpecMaint>(); 
    kitSpecification.Hdr.Current = PXSelect<INKitSpecHdr, Where<INKitSpecHdr.kitInventoryID, Equal<Required<INKitSpecHdr.kitInventoryID>>>>.Select(Base, Base.Transactions.Current.InventoryID); 
    throw new PXRedirectRequiredException(kitSpecification, true, "Kit Specification") { Mode = PXBaseRedirectException.WindowMode.NewWindow }; 
} 
+0

謝謝。但我想要展示Kit Specification(IN209500),而不是Kit Assembly(IN307000)。什麼應該是正確的圖表使用?試過INKitSpecMaint,但它給我所有種類的錯誤,因爲它沒有搜索定義等。 – Rick

+0

我更新了我的答案以涵蓋套件規格。 –