Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

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

(0) ShareShare
ReportReport
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!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans