I have a new processing screen set up with a column for OrderNbr. The view is created from:
public SelectFrom<SOOrder>
.LeftJoin<Note>.On<SOOrder.noteID.IsEqual<Note.noteID>>
.Where<
SOOrder.orderType.IsEqual<wOOrderType>
.And<SOOrder.shipVia.IsNotLike<intlShipVia>>
.And<SOOrder.shipVia.IsNotLike<dropShipStart>>
.And<SOOrder.status.IsEqual<SOOrderStatus.open>>
.And<SOOrder.ownerID.IsNull>
.And<Note.noteID.IsNull
.Or<Note.noteText.IsNull>
.Or<Note.noteText.IsEqual<Empty>>
.Or<Note.noteText.IsLike<signatureWaived>>>
.And<SOOrder.curyOrderTotal.IsLessEqual<orderTotalMaxSpend>>
.And<
SOOrder.paymentMethodID.IsIn<
paymentMethodAFFIRM,
paymentMethodPAYPAL,
paymentMethodAFTERPAY,
paymentMethodCCARD>
>
>
.ProcessingView AISOOrder;I have added an action as:
public PXAction<SOOrder> ViewDocument;
[PXButton]
[PXUIField(DisplayName = "View Order", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
public virtual void viewDocument()
{
var order = AISOOrder.Cache.Current as SOOrder;
PXTrace.WriteInformation($"Selected OrderNbr: {AISOOrder.Current?.OrderNbr}, OrderType: {AISOOrder.Current?.OrderType}");
if (order?.OrderNbr != null)
{
SOOrderEntry docGraph = PXGraph.CreateInstance<SOOrderEntry>();
docGraph.Document.Current = PXSelect<SOOrder,
Where<SOOrder.orderNbr, Equal<Required<SOOrder.orderNbr>>,
And<SOOrder.orderType, Equal<Required<SOOrder.orderType>>>>>
.Select(this, order.OrderNbr, order.OrderType);
if (docGraph.Document.Current != null)
{
PXRedirectHelper.TryRedirect(docGraph, PXRedirectHelper.WindowMode.NewWindow);
}
}
}The problem I have is that whichever OrderNbr I click on in the grid it always opens a new window for the first order in the grid unless I have previously clicked the Selected field.
Am I missing something really obvious that would enable the current row to be selected one?
I can provide the customization file if that would help. I’m really tearing out my hair on this one.
Thanks for any and all help,
Phil