Showing posts with label NAV. Show all posts
Showing posts with label NAV. Show all posts
0

NAV - Quit - Break - Skip - Exit

Posted by Nantharupan on 7:01 AM in , , ,
When i was searching for the difference of these function, i found the answer from the following blog, i just copied that again for the quick reference. 
http://www.navisioncanbefun.com/2010/quit-break-skip-exit/

1. Quit 
Quit can only be used in Report, Dataport or XMLport. (Like Currreport.quit). It quits (come out from) the report or dataport or XMLPORT. If some processing of data happened before the quit statement, all of those data manipulations will be reversed (rolled back).
2. Break
Break can be used in 2 places –
a. in any loop (repeat..until) – This statement will break the loop and come out of the loop without further processing. All the data manipulation before this statement will remain intact.
b. In a report or dataport or XMLport. This statement will take you out from any trigger (like on prereport, Onpresection etc)
3. SKIP 
SKIP is only used in Report / Dataport / XMLPORT. This statement skips the iteration of a dataitem.
4. EXIT
EXIT normally used in functions / triggers to return a value. (say a function returns a numeric value –
Myfunction(integer A, Integer B) Integer—
EXIT(A+B);

0

GET - NAV

Posted by Nantharupan on 10:06 PM in , , ,
Its just a tip.

When ever we wanted to filter the record, we tend to use SETRANGE() or SETFILTER() and FINDFIRST()... However, we should keep in mind that, if we are filtering based on the Primary Key, then we can use GET(), it does all the work, we do by writing some lines of code with one life of code.

CustomerRec.RESET();
CustomerRec.SETRANGE("No.", 1291);
CustomerRec.FINDFIRT();


This can be done by using following code,

CustomerRec.GER(1291);

Hope this tip helped some one.!

0

Difference between SETRANGE and SETFILTER

Posted by Nantharupan on 12:15 PM in , , ,
We often face situation to filter record in NAV. There are two function can be used most of the time interchangeable for simple filters. However there might be performance consequences. 

  • SETFILTER()
       It can be assign a filter on a record to a filed we specify. It often used to do the complex filtering. 

  • SETRANGE()
       It is a simple filter, where single value or single range can be set on a field. 

SETRANGE give us a quick way to set up the Filer. 

CustomerRec.SETRANGE("No.", 100, 200); 

Above line simple filter the customer record with customer number from 100 to 200. 

The same functionality can be achieved by using SETFILTER() as follows

CustomerRec.SETFILTER("No.", '>=100&<=200');

We can see the difference. When using the SETFILTER() we should construct the filter statement. However we can not achieve complex filters using SETRANGE().

It is an incomplete post.....





Popular posts

Copyright © 2009 On the way All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.