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

SysQuery vs SysQueryRangeUtil

(0) ShareShare
ReportReport
Posted on by 1,965

Hi,

1) What is the difference between SysQuery and SysQueryRangeUtil and when to use each one?

2) what is the difference between SysQuery::Range and  SysQueryRangeUtil::dataRange

3) what is the difference between add range and findOrCreate range and when to use each one

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Hi IntegrationBeginner,

    I think most of your questions can be best answered by opening the AOT. It offers great documentation about many standard objects.

    1) They are two different classes, you can actually see the full source code in AOT and find all the differences. You can select one that suits your requirement. If both suit your requirement, you can use either one. You can use cross references to see how they're used in the system

    2) There's no method "dataRange" in SysQueryRangeUtil. Perhaps you mean "dateRange"? Anyway, you can actually find full XML documentation of both functions in AOT right above the method declaration.

    3) addRange always adds a new range. findOrCreateRange finds existing range for provided table field, and creates a new one if it doesn't exist. You should use addRange if you want to add multiple ranges for same field. You should use findOrCreateRange if you want to replace possibly existing range for the field (avoid having multiple OR ranges for same field). If you have just created a query in x++ and just want to add one range, you can use either one.

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 663 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 348 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans