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
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
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. :)
"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?
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.
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.
Mohamed Amine Mahmoudi
100
Super User 2025 Season 1
Community Member
48
shanawaz davood basha
6