2

I'm looking for difference between ax query and select (or while select) In this example i don't see what's i can not do with statement select : the example of ax query in msdn

I think I misunderstood the syntax of ax query ranges :'(

jawhar_m
  • 145
  • 5
  • 13

1 Answers1

4

A (while) select is a 'one use' statement, ie, you put it inline in your code and it is used only there.

A query can be setup to require parameters and can be used multiple times throughout your class or saved into the AOT for use in any class.

Generally I only use select statements for simple queries where its not worth the effort to create a query, for anything more complex I use queries.

Zordey
  • 656
  • 5
  • 10
  • 1
    Complex queries (with joins) are way easier to read as code. I think the relevant issue is whether you want a dynamic query with user provided ranges. A 4 table join in a while select is okay if the query is "static". – Jan B. Kjeldsen Jun 08 '12 at 11:19
  • 1
    Note: AX 2012 full text indexes are not supported in a select statement. In this (rare) case you have to use a query. – Jan B. Kjeldsen Jun 08 '12 at 12:37