1. Select the C/AL Editor, click View, and then click C/AL Globals.
2. In the C/AL Globals window, click the Functions tab.
3. Enter a name for each function that you want to add.
4. Click Locals to define the parameters, return value, local variables, and text constants in the C/AL Locals window.
5. In the C/AL Locals window, click the Parameters tab and specify the calling method, name, and data type of each parameter. You can also specify a subtype and a length, but this is optional.
The calling method can be specified as Var, which means that the parameter is passed by reference rather than by value. The value of a variable can only be changed by a function when it is passed to the function by reference. When the parameter is not specified as Var, only a copy of the variable is passed to the function. If the function changes that value, the change only affects the copy and not the variable itself.
If the type that you select corresponds to an application object, you must also add a subtype, that is, the name of a specific object in the database. If you select text or code you have to define a length. The default length is 10 characters for code and 30 characters for text.
6. In the C/AL Locals window, click the Return Value tab and specify the return value for your new function. Enter a name for the return value and select a data type from the drop-down list. If the data type is text or code, you can also select a length.
7. n the C/AL Locals window, click the Variables tab and define local variables.
8. In the C/AL Locals window, click the Text Constants tab and define text constants for the function.
1 comment:
Thanks a lot for this post, Sir.
Im a complete beginner in navision, and i find your posts educative.
Looking forward to more posts!
G!
Post a Comment