Global class in axapta
All methods in the Global class are static methods. You can create instance methods in the Global class. However using an instance method would require declaring the class.
The idea with Global is to have a collection of function create in X++ which can be referenced without specifying the class name. Methods in global are referred in the same way as a system function.
Several of the methods are a supplement to the functions used for base type operations like the Global method date2StrUsr() which convert a variable of the type date to a string formatted by the user default date settings.
You can add your own methods to the Global class. This can be useful if you have a piece of code often used. Before adding your own Global method, you should check the existing Global methods and the system functions located under System Documentation/Functions as you might find a function already solving your needs.
All methods in the Global class are static methods. You can create instance methods in the Global class. However using an instance method would require declaring the class.
The idea with Global is to have a collection of function create in X++ which can be referenced without specifying the class name. Methods in global are referred in the same way as a system function.
Several of the methods are a supplement to the functions used for base type operations like the Global method date2StrUsr() which convert a variable of the type date to a string formatted by the user default date settings.
You can add your own methods to the Global class. This can be useful if you have a piece of code often used. Before adding your own Global method, you should check the existing Global methods and the system functions located under System Documentation/Functions as you might find a function already solving your needs.