Functions are created in all languages and perform various tasks uniquely.
That's the reason why functions are useful in a coding of all types Languages.
Creating a Function needs to be needs needs 3 Basic Steps :
1. Defining and Creating the Defination of Function.
2.Calling the Function.
3. Passing the Paraments and Arguments into the function so that it provide output.
Now,
as navision is using C/AL Language in its heart to define and work the logics.There is only one thing common is Function.
Calling the Function and creating the Function and Defining the Function.
Due to this Fact , understanding Functions is very much necessary for beginners and experts of NAV TECHNICAL Consultants.
Functions are easy to create in NAV. Now passing the parameters and calling the functions is explained below.
There are two functions which I had created and Called it via
CALL BY REFERENCE & CALL BY VALUE.
By Default All Variables in Functions inside NAV Dev are Pass by Value which means a copy is created for parameter and passed.
Variables Used:
CustRec Record 18
Old Name Text 50
New Name Text 50
ChangeCustomerName and ChangeCustomerNameRef are two functions Created in which
Customer variable is taken First one is Pass By Value and Second one is Pass By Reference.
The Code is As Follows :
(This code is only for study purpose taken as Example.If any Objections then Kindly mail)
The Final Result is as under screenshot.
Result 1:-
Result 2: