web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Forcing query to use QUERY USED instead of PREVIOUSLY USED QUERY

(0) ShareShare
ReportReport
Posted on by 2,699

Hi,

This might be easy but asking for reference.

I am executing the QueryRun class to instantiate an instance of a query.

I am calling the QueryRun.Prompt() so the user can add additional range values etc.

I am also setting some ranges on the fly in the query object just before I execute queryRun.

My question is simply, how do I force the parameter in the SELECT QUERY to use QUERY USED instead of the cached usage data value PREVIOUSLY USED QUERY?

I have the same question (0)
  • Suggested answer
    Kauto Profile Picture
    2,699 on at

    Ignore this - I have found that if I use SysQueryRun instead of QueryRun class I get the parameter promptLoadLastQueryUsed() and setting that to False will result in the QUERY USED parameter being set instead of a cached or saved from usage data.

  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    Hi Kauto,

    Although you have found the solution through SysQueryRun.

    Try calling QueryRun.reset() method and check whether its help your scenario.

    Thanks,

    Girish S.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 464 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans