Reputation: 773
I have a view delegate to sort items. Which is working fine. But the issue is, hyperlink is not picking up current record, it is picking up the first record. Here is my sample code:
protected virtual void viewname()
{
PXView query = new PXView(this, true, this.viewname.View.BqlSelect);
query.OrderByNew<OrderBy<Asc<DACname.field1, Desc<DACname.field2,
Desc<DACname.field3>>>>>();
}
Upvotes: 0
Views: 198
Reputation: 11
Remove the view delegate and try to add the order by directly into the data view like Evgeny Kralko example [2.Don't try to sort items via delegate, you should do it via BQL view declaration]
Remove the view delegate and move the query.OrderByNew<OrderBy<Asc<DACname.field1, Desc<DACname.field2, Desc<DACname.field3>>>>>();
into graph ctor or Initialize()
if graph extension.
Example:
public GraphName()
{
this.ViewName.OrderByNew<OrderBy<Asc<DACName.field>>>();
}
Upvotes: 1
Reputation: 342
1.First of all, please try to add SyncPosition="True"
expression to your ASPX file:
<px:PXGrid runat="server" SyncPosition="True" ...
2.Don't try to sort items via delegate, you should do it via BQL view declaration
PXSelect<ARTax, ...,
OrderBy<Asc<ARTax.tranType, Asc<ARTax.refNbr, Asc<ARTax.taxID>>>>> Tax_Rows;
3.Looks like something wrong with your delegate declaration, try to return items from there, something like this:
public virtual IEnumerable taxes()
{
foreach (PXResult<ARTaxTran, Tax> res in PXSelectJoin<ARTaxTran,
LeftJoin<Tax, On<Tax.taxID, Equal<ARTaxTran.taxID>>>,
Where<ARTaxTran.module, Equal<BatchModule.moduleAR>,
And<ARTaxTran.tranType, Equal<Current<ARInvoice.docType>>,
And<ARTaxTran.refNbr, Equal<Current<ARInvoice.refNbr>>>>>>.Select(this))
{
...
yield return res;
}
}
Upvotes: 0