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
0
Comments
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.
Object Manager
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.
The new commands are not used everywhere in the new code.
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.
http://mibuso.com/blogs/davidmachanick/
Another limitation is FINDSET can't use ascending recordsets.
Also what happens when you set a value and the record set has more than that?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!