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

Announcements

No record found.

News and Announcements icon
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,709

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,709 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,833 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 512 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 386

#3
Adis Profile Picture

Adis 259 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans