Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

error on locking QuerybuildRange in initializeQuery() method of the ListpageInteraction class

Posted on by Microsoft Employee

Hi,

I have below statements in InitializeQuery() method of the ListPageInteraction Class

qbr = qbds.addRange(fieldNum(MyTable,EndDate));
qbr.value(queryRange(systemDateGet(),dateNull()));


qbds.addOrderByField(fieldNum(MyTable, EndDate), SortOrder::Ascending);

I want to lock down the EndDate  so that no one can select past dates. It should be always today or future date.

but when i put below line after the qbr.value  line, it throws the error.

qbr.status(RangeStatus::Locked)  

Below is the error. Any hint on how to lock the range?

-----------------------------------------------------------------

An unhandled error has occurred. To view details about this error, enable debugging in the web.config file or view the Windows event logs.

Operation is not valid due to the current state of the object.

Microsoft.Dynamics.Framework.Portal

at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxFilter.GetFilterStringFromPostBackValue(String postBackValue)
at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxFilter.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,151 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,993 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans