我有一个查询页面,其中Header是POLine表,而grid是一个链接到POLine的新表。我不能在过滤器上使用无界的DAC,因为我想提供在现有记录上导航的选项。
如果我直接打开页面并输入POLine信息,则网格会正确刷新。
我在“采购订单”页面中添加了一个按钮,其中的操作可以打开我的查询页面。在这种情况下,过滤器已正确加载,但网格不会显示记录,直到按下网格的刷新按钮。
这是我的行动:
public PXAction<POOrder> Reconcile;
[PXUIField(DisplayName = "Reconcile", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXButton(CommitChanges = true, OnClosingPopup = PXSpecialButtonType.Cancel)]
public virtual void reconcile()
{
POLine pOLineRow = Transactions.Current;
if (pOLineRow == null)
{
return;
}
if (pOLineRow.OrderNbr != null)
{
PEPOOrderReconciliationMaint pEPOOrderReconciliationgraph = PXGraph.CreateInstance<PEPOOrderReconciliationMaint>();
pEPOOrderReconciliationgraph.POOrderReconcileRecord.Current = pEPOOrderReconciliationgraph.POOrderReconcileRecord.Search<POLine.orderType, POLine.orderNbr, POLine.lineNbr>(pOLineRow.OrderType, pOLineRow.OrderNbr, pOLineRow.LineNbr, pOLineRow.OrderType);
if (pEPOOrderReconciliationgraph.POOrderReconcileRecord.Current != null)
{
throw new PXRedirectRequiredException(pEPOOrderReconciliationgraph, false, "PORECONCILIATION") { Mode = PXBaseRedirectException.WindowMode.NewWindow };
}
}
}
我没有使用过搜索&lt;&gt;在详细级别之前的方法,但我在POReceiptEntry中找到了这个Acumatica参考:
POLineR polineR = _graph.purchaseLinesUPD.Search<POLineR.orderType, POLineR.orderNbr, POLineR.lineNbr>
(itemsource.OrderType, itemsource.OrderNbr, itemsource.LineNbr);
我还尝试直接使用PXSelect分配值:
pEPOOrderReconciliationgraph.POOrderReconcileRecord.Current = PXSelect<POLine,Where<POLine.orderType,
Equal<Required<POLine.orderType>>,And<POLine.orderNbr,
Equal<Required<POLine.orderNbr>>,And<POLine.lineNbr,
Equal<Required<POLine.lineNbr>>>>>>
.Select(this, pOLineRow.OrderType, pOLineRow.OrderNbr, pOLineRow.LineNbr);
我不认为这与错误有关。我认为它更倾向于ASPX中的刷新选项。
这是我的ASPX代码:
<%@ Page Language="C#" MasterPageFile="~/MasterPages/FormDetail.master" AutoEventWireup="true" ValidateRequest="false" CodeFile="PR501000.aspx.cs" Inherits="Page_PR501000" Title="Untitled Page" %>
<%@ MasterType VirtualPath="~/MasterPages/FormDetail.master" %>
<asp:Content ID="cont1" ContentPlaceHolderID="phDS" Runat="Server">
<px:PXDataSource ID="ds" runat="server" Visible="True" Width="100%" TypeName="Purchase.PEPOOrderReconciliationMaint" PrimaryView="POOrderReconcileRecord">
<CallbackCommands>
<px:PXDSCallbackCommand Name="SaveClose" Visible="false" PopupVisible="false"/>
<px:PXDSCallbackCommand Name="Save" Visible="false" CommitChanges="true"/>
<px:PXDSCallbackCommand Name="Cancel" Visible="true" CommitChanges="true"/>
<px:PXDSCallbackCommand Name="Insert" Visible="false" CommitChanges="true"/>
<px:PXDSCallbackCommand Name="CopyPaste" Visible="false" CommitChanges="true"/>
<px:PXDSCallbackCommand Name="Delete" Visible="false" CommitChanges="true"/>
</CallbackCommands>
</px:PXDataSource>
</asp:Content>
<asp:Content ID="cont2" ContentPlaceHolderID="phF" Runat="Server">
<px:PXFormView ID="form" runat="server" DataSourceID="ds" Style="z-index: 100"
Width="100%" DataMember="POOrderReconcileRecord" TabIndex="4500">
<Template>
<px:PXLayoutRule runat="server" StartColumn="True">
</px:PXLayoutRule>
<px:PXDropDown ID="edOrderType" runat="server" DataField="OrderType">
</px:PXDropDown>
<px:PXSelector ID="edOrderNbr" runat="server" DataField="OrderNbr" AutoRefresh="True" CommitChanges="True">
</px:PXSelector>
<px:PXLayoutRule runat="server" StartColumn="True"/>
<px:PXSelector ID="edLineNbr" runat="server" CommitChanges="True" DataField="LineNbr">
</px:PXSelector>
</Template>
</px:PXFormView>
</asp:Content>
<asp:Content ID="cont3" ContentPlaceHolderID="phG" Runat="Server">
<px:PXGrid ID="grid" runat="server" DataSourceID="ds" Style="z-index: 100; margin-top: 0px;"
Width="100%" Height="150px" SkinID="Details" TabIndex="21000" KeepPosition="True" SyncPosition="True" AdjustPageSize="Manual">
<Levels>
<px:PXGridLevel DataKeyNames="OrderType,OrderNbr,LineNbr" DataMember="POReceiptLineRecord">
<RowTemplate>
<px:PXSegmentMask ID="edInventoryID" runat="server" DataField="InventoryID" CommitChanges="True" Size="M" Width="200px">
</px:PXSegmentMask>
<px:PXNumberEdit ID="edReceiptQty" runat="server" AlreadyLocalized="False" DataField="ReceiptQty" CommitChanges="True" Size="S">
</px:PXNumberEdit>
</RowTemplate>
<Columns>
<px:PXGridColumn DataField="InventoryID">
</px:PXGridColumn>
<px:PXGridColumn DataField="ReceiptQty" TextAlign="Right" Width="100px">
</px:PXGridColumn>
</Columns>
</px:PXGridLevel>
</Levels>
<AutoSize Container="Window" Enabled="True" MinHeight="150" />
</px:PXGrid>
</asp:Content>
这是PEPOOrderReconciliationMaint代码:
public class PEPOOrderReconciliationMaint : PXGraph<PEPOOrderReconciliationMaint, POLine>
{
public PXSelect<POLine> POOrderReconcileRecord;
public PXSelect<POReceiptLine,
Where<
POReceiptLine.pOType, Equal<Current<POLine.orderType>>,
And<POReceiptLine.pONbr, Equal<Current<POLine.orderNbr>>,
And<POReceiptLine.pOLineNbr, Equal<Current<POLine.lineNbr>>>>>> POReceiptLineRecord;
#region Cache Attached
#region OrderType
[PXDBString(2, IsFixed = true, IsKey = true)]
[POOrderType.List()]
[PXUIField(DisplayName = "Type", Enabled = true)]
protected virtual void POLine_OrderType_CacheAttached(PXCache Sender)
{
}
#endregion
#region OrderNbr
[PXDBString(15, IsUnicode = true, InputMask = "", IsKey = true)]
[PXUIField(DisplayName = "Order Nbr.", Visible = true)]
[PXSelector(typeof(Search<POOrder.orderNbr,
Where<POOrder.orderType, Equal<Current<POLine.orderType>>>>))]
protected virtual void POLine_OrderNbr_CacheAttached(PXCache Sender)
{
}
#endregion
#region LineNbr
[PXDBInt(IsKey = true)]
[PXUIField(DisplayName = "Line Nbr.", Visible = true, Enabled = true)]
[PXSelector(typeof(Search<POLine.lineNbr,
Where<POLine.orderNbr, Equal<Current<POLine.orderNbr>>,
And<POLine.orderType, Equal<Current<POLine.orderType>>>>>))]
protected virtual void POLine_LineNbr_CacheAttached(PXCache Sender)
{
}
#endregion
#endregion
}