Code conversion tool
pvar
Member Posts: 157
I am in the process of doing an object upgrade from 3.6 to 2009. The commands FIND('-') and FIND('+') have been replaced by FINDFIRST, FINDSET and FINDLAST in 2009. Is there a tool that I can use to replace all the old find's with the new find's? we have a lot of custom code.
Thanks
Thanks
0
Comments
-
FIND('-') and FIND('+') were not replaced by FINDFIRST, FINDSET and FINDLAST. These are new commands that are available in addition to the older command. Depending on the situation you may not always want to replace the older commands.There are no bugs - only undocumented features.0
-
I am afraid that this cannot be automated.
The command FIND('-') can be converted to 'FINDSET', 'FINDFIRST' AND 'NOT ISEMPTY'.
It depends on the situation.
To replace the FIND('+') with FINDLAST you can export all objects in textformat and do a replace with e.g. notepad.Reijer Molenaar
Object Manager0 -
I heard that the new commands are more efficient that the old ones and recommended. Is there any particular situation where the old command works better than the new one?
As reijermolenaar said I could replace all the find('+) with FINDLAST with a find & replace command in some editor. But Find('-') needs to be replaced with FINDFIRST or FINDSET depending on if you are trying to fetch just the first record or a set of records and that is where I need some help.
Another reason I wanted to do this is for consistency in the code because the base code has the new find commands every where.0 -
FIND('+') is not always functionally equilalent to FINDLAST.
The new commands are not used everywhere in the new code.There are no bugs - only undocumented features.0 -
When looping thru very large datasets the old commands can be better to use. There was a thread discussing this but I can't seem to find it.There are no bugs - only undocumented features.0
-
I think the findset in version 4 and 5 pull in the first 500 rows. In NAV2009 that drops to 50.
So, I think that means if your working set is larger, you should use the old commands.
Plus if you are having to modify the key, the findset has to refresh the set after each update.David Machanick
http://mibuso.com/blogs/davidmachanick/0 -
The number of records retreived by FINDSET is determined by the "record set" in the DB setup. But setting this to high can cause other issues.
Another limitation is FINDSET can't use ascending recordsets.There are no bugs - only undocumented features.0 -
Where exactly is that setup?
Also what happens when you set a value and the record set has more than that?0 -
File - Database - AlterThere are no bugs - only undocumented features.0
-
I recommend to read more about the commands on this forum. You will see that it is not just simple replacement. FINDLAST and FINDFIRST are good only when you are not looping through the records. ISEMPTY is good if you just wants to know if there is something or not but you do not need the data. FINDSET is good for looping, but have two parmters which can differ based on the context. etc... 8)0
-
Read this to start with: How to work with record-variables?No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Thanks to all for your valuable suggestions. I think I could summarize what every one says to the following
Use ISEMPTY to see if there are any records exists in the table
Use FINDFIRST or FINDLAST if you want to find just the first or last record
Use FINDSET if you want to loop through a record set and the record set is small and loop in ASCENDING order
Use FIND('-') if you want to loop through a record set when the record set is large or loop in DESCENDING order
I still didn't know what happens in a situation where you use FINDSET and it returns a record set larger than what defined in the database setting. I don't think it is going to do anything really bad other than being a slow fetch.0 -
If the record set is greater than the 500 in 5.0 and 50 in 2009, then FINDSET after the last record will behave like find('-') and created server cursor and loop through it and return one record at a time.0
-
[Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 323 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions



