Monday, November 14, 2016

HOw USE OF FINDSET in MS Dynamics NAV 2017?.

How to use FINDSET



As per MSDN,Findset gets the records on the basis of filters applied over the record type.
If now filters are applied then we can use it to update all records present in table using REPEAT UNTIL.

I had defined these two variables in navision.

DIFFERENCE between FINDSET,FINDFIRST,FINDLAST in NAVISION.

FINDSET :- It retrieves 50 records in tables and update it one by one.
FINDLAST :- It points to LAST Record in a DATASET Filter.
FINDFIRST :- It points to FIRST Record in DATASET FILTER.



Following is the code which I had written to get the processed data in a table.




This is the desired result:













How to use DATE2DWY Function in Navision?.


CASE are similar to all other languages in Navision. 


The only difference is in Syntax but the basic concept remains same.


Here I am going to convert a Date to a number using DATE2DWY and that number is used in CASES to define a Weekday in Navision. 

So these variables I had defined:





The Code is very simple just notice the syntax for CASE in Navision.







Here is the result.




Difference B/W Pass By Reference & Pass By Value (Miracle Solved & Explained For all Languages)

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: