To Create a New Class in AX 2012
Steps:
1. Open the AOT.2. Find the Classes node.
3. Right-click and select New Class.
4. Expand the node for the newly created class.
5. Double-click the classDeclaration.
6. Rename the class to PrintMyName.
7. Declare a variable of type String, called "myName".
8. Press F8 to compile and save the classDeclaration.
9. Right-click the class and select New Method.
10. Double-click the new method.
11. Rename the method to "setMyName".
12. Enter the code in the setMyName method shown below into your
method.
13. Press F8 to compile and save the method.
14. Right-click the class and select New Method.
15. Double-click the new method.
16. Rename the method to "printMyName".
17. Enter the code in the printMyName method show below into your
method.
18. Press F8 to compile and save the method.
Source Code :
public class PrintMyName{
str 20 myName;
}
private void setMyName()
{
myName = "Isaac";
}
private void printMyName()
{
print MyName;
}
No comments:
Post a Comment