In the previous example, we simply call a function that displays a hardcoded message. But if we want to make the function more flexible and able to show different text, we must pass a text parameter into the function. Function parameters in NAV are declared in the same way as functions themselves. A line of code representing the function declaration in the code editor is not editable. Parameters are described in a separate editor window instead. In this section, we will see how to pass parameters to a function and return a resulting value from it.
Function parameters and return values
How to add parameters to a function
Let's modify the codeunit so that the message to be shown to the user will be passed in the function...