Home » Microsoft » MB6-704 » Which type of method should you use?
You have a table named Tablel that contains the information from a sales invoice.
For Tablel, you need to create a method named Tax Amount that will return the total amount of tax for the invoice. The method will be used in a report to show the tax amount information.
Which type of method should you use?
A. Static
B. Accessor
C. Main
D. display
Correct Answer: A
Explanation/Reference:
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.
Reference: Methods in X++ [AX 2012]