AX2009 EP: Exception when no records in the grid under filte

Oleksnadr_ka
Member Posts: 2
Hello all
I'm trying to make a custom filter just as in video webinar on msdn.
In the top of the grid - list box with two values: "My" and "ALL". On text chenged I call X++ filtering procedure:
Works fine until there is no records under the filtered ranges. In this case - a big exception:
After this connector is broken, user has to refresh the page to make filter work again.
I see the problem is common for asp.net but I do not have a clue how to fix it in AX EP.
I would appreciate your help.
Thanks.
I'm trying to make a custom filter just as in video webinar on msdn.
In the top of the grid - list box with two values: "My" and "ALL". On text chenged I call X++ filtering procedure:
{ QueryBuildDatasource qbdsInventSerial; ; if (_index == 1) { qbdsInventSerial = InventSerial_q.dataSourceName(InventSerial_ds.name()); qbdsInventSerial.clearRange(fieldnum(InventSerial,HoldByUser)); qbrMyVehicles = qbdsInventSerial.addRange(fieldnum(InventSerial,HoldByUser)); qbrMyVehicles.value(curuserid()); qbrMyVehicles.status(RangeStatus::Open); InventSerial_ds.executeQuery(); } }
Works fine until there is no records under the filtered ranges. In this case - a big exception:
Specified argument was out of the range of valid values. Parameter name: index at Microsoft.Dynamics.Framework.Data.Ax.DataSetView.GetElement(Int32 index) at Microsoft.Dynamics.Framework.Data.Ax.DataSetView.GetCurrent() at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxCurrentRecordDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() at System.Web.UI.WebControls.BaseDataBoundControl.set_RequiresDataBinding(Boolean value) at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewChanged(Object sender, EventArgs e)
After this connector is broken, user has to refresh the page to make filter work again.
I see the problem is common for asp.net but I do not have a clue how to fix it in AX EP.
I would appreciate your help.
Thanks.
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions