I have a custom form and I want to do filtering on the View. I’ve had a similar issue in the past which I resolved on this previous post:
I’m following the same principles in my code here, but I am getting an error.
In my override, my BqlCommand is EXACTLY the same as the original view select statement. I was just ensuring that the code would work before making any changes to the BqlCommand.
public SelectFrom<ICSFSSScheduleLine>
.Where<ICSFSSScheduleLine.scheduleID.IsEqual<ICSFSSSchedule.scheduleID.FromCurrent>>
.OrderBy<Asc<ICSFSSScheduleLine.lower>, Asc<ICSFSSScheduleLine.upper>, Asc<ICSFSSScheduleLine.cutoffDate>>
.View DetailsView;
protected virtual IEnumerable detailsView()
{
ICSFSSSchedule currentRecord = ScheduleView.Current;
BqlCommand query;
//plan to do stuff here to change the query based on other factors
query = new SelectFrom<ICSFSSScheduleLine>
.Where<ICSFSSScheduleLine.scheduleID.IsEqual<ICSFSSSchedule.scheduleID.FromCurrent>>
.OrderBy<Asc<ICSFSSScheduleLine.lower>, Asc<ICSFSSScheduleLine.upper>, Asc<ICSFSSScheduleLine.cutoffDate>>();
var view = new PXView(this, true, query);
foreach (PXResult<ICSFSSScheduleLine> item in view.SelectMulti(null))
{
yield return item;
}
}
When the foreach (PXResult<ICSFSSScheduleLine> item in view.SelectMulti(null)) fires, I get this error:
My code is almost a literal cut and paste from my other post linked above which worked.
I’m stumped.