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 :
Microsoft Dynamics AX (Archived)

merge two queries in X++

(0) ShareShare
ReportReport
Posted on by

Hello.

I have two queries, that I need to merge them together in that way:

Query1 has several datasources.

I want to replace datasource no 5 (i.e) with a specific query (with all of the attribute, like range, link, etc.)

Can I do it in a simple way?

Thanks :)

*This post is locked for comments

I have the same question (0)
  • Iulian Cordobin Profile Picture
    8,201 on at

    Where you want this done? AOT or code?

  • Pradeep Itnal Profile Picture
    3,248 on at

    To me its not very clear, how complicated are your joins:

    Option1: However you can use Temporary table and push the data into it and then use it in joins.

    Option2: you can check if there are any views already existing in AOT, which you can reuse.

  • Community Member Profile Picture
    on at

    In code.

  • syed baber Profile Picture
    11,633 on at

    Hi Eitan,

    Can you please tell us the requirement which you are tying to achieve? May be there is a much simpler way to achieve it.

    Thanks,

    Baber.

  • Community Member Profile Picture
    on at

    the functions sysQuery::mergeRanges and/or sysQuery::mergeFilters might help you ....

  • Verified answer
    Community Member Profile Picture
    on at

    I didn't see that sysQuery::mergeRanges merge two queries (none of the examples work).

    Seems there is no simple solution.

    I will manage somehow.

    Thanks, anyway :)

  • Community Member Profile Picture
    on at

    it doesn't, it only merges ranges/filters, but it might help you in writing some clever piece of code that results in the merge of two queries .... the sysQueryBuild* classes will surely help you

  • santoshkmrsingh Profile Picture
    25 on at

    Hi Eitan were you able to make this work ? mind sharing some insights i have a similar requirement. 

  • Suggested answer
    santoshkmrsingh Profile Picture
    25 on at

    solved the problem for anyone looking at a solution please refer the below link

    santoshkmrsingh.blogspot.com/.../merge-queries.html

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Scott_itD Profile Picture

Scott_itD 2 Community Manager

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans