Sunday, April 13, 2014

What is Static method and Main method use.

Static Method

Static methods, or class methods, belong to a class and are created by using the keyword static. They are called by using the following syntax:
ClassName::methodName();
You do not need to instantiate an object before you use static methods. Static methods are widely used in Microsoft Dynamics AX to work with data that is stored in tables.


Main method

A main method is a class method that is executed directly from a menu option.
static void main (Args _args)
 {
     // Your X++ code here.
 }
The method should only create an instance of the object and then call the necessary member methods. The _args parameter allows you to transfer data to the method.

No comments:

Post a Comment