Notifications
Announcements
No record found.
Hello!
What is the difference between those two stuff? When should I use first or second instead of just method on my object?
*This post is locked for comments
You're comparing apples, oranges and locomotives.
A job is an executable piece of code, almost as a class with a single main method.
A query is used for reading data from database.
Neither is a replacement for an instance method.
Job:
piece of code, used/recommended for testing purpose. Testing refer to testing of anything. e.g. I want to test Numerals2Text, I may use a job for its testing.
Technically jobs can work for real world practical tasks also, but recommend only for testing purpose.
in short you code for testing is usually I jobs.
Query:
Query has same concept as it has in any structure query language. it can be used for multiple purposes. you can use it behind any report, behind nay view, behind any form.
"You're comparing apples, oranges and locomotives" -Good one :)
1) So Jobs are more like sub -programs with ability to live independently or as a part of some workflow?
2) Why should I use Queries if I can type X++ code (I mean this "t-SQL-style" code) in any place I want to?
1) Jobs are not used for any production code and no product should be shipped with them. Use them only in development if you want to try something.
2) Queries integrated in X++ are still queries, nevertheless you seems to be asking why to use the query framework, such as queries in AOT and the Query class. The answer is reusability and extensibility. You can use such queries as form and report data sources, you can add ranges and data sources at runtime etc. Try the same with a select statement. :)
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2