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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Query on RunBaseBatch always "Previously used query"

(0) ShareShare
ReportReport
Posted on by 811

Hi,

I have 2 RunBaseBatch extended classes.

When I run the class and go to the Query dialog, in one class I always get "Currently used" and in the other class I always get "Previously Used Query".

Nevertheless, the way the query is implemented is identical in both classes.

The only difference is, on one class there is a dialogfield and on the other class none.

Important note: the query in both classes is on the same table, but are instantiated locally in the class itself.

Any help welcome!

Thanks,

 Sven

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi,

    Look into the pack() and unpack() methods.  These methods are used to save queries from previous runs.

  • Sven Joos Profile Picture
    811 on at

    Yes, I know. These are implemented fine.

    I was talking about the dropdown you see on top of the query-object screen where you can select a previously saved query.

    By default there are always 2 options: "Use Current" or "Previously Used Query".

    On one class it always says: "Use Current" and on the other "Previously Used Query".

    I can't figure out why this is.

    Cheers,

    Sven

  • Community Member Profile Picture
    on at

    The query selection criteria screen that is shown on report dialogs is by default using the system form SysQueryForm. For the reports that are behaving strangely, you should check in DataSources/Query/Form which form is used for query dialog, and then if there are any customizations made compared to the original SysQueryForm code. In SysQueryForm you should look at various methods that might be changing the status and values of SavedQueriesBox combo box, e.g. on the buildForm(), run() or other methods.

  • Community Member Profile Picture
    on at
    Yes.  Also check to see if any values are passed into SysQueryForm from your calling class.  You can also take away your dialog field in your class to see if SysQueryForm acts different with / without dialog fields.
  • Suggested answer
    Mykhailo Stakhniv Profile Picture
    180 on at

    You can use

    queryrun.saveUserSetup(false);

    if you want to disable "Previously Used Query" option

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans