I need to check where are the calls to a specific function that is present in a codeunit that is part of an add-on. In other words I have the function called "FunctionToBeFound" and I need to know where it is called in all NAV code inside a database (code in tables, forms, codeunits and so forth). Taking into account that it is a function part of an add-on, I am expected that it is not present in the standard code, but it is not enough.
Is there a specific functionality in NAV that finds a string in a massive/mass mode in an acceptable time? Or any other way?
0
Comments
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
I think there used to be a free light version, but I guess that is gone now.
Give the Advanced edition a try with the free time-limited trail: http://www.mibuso.com/dlinfo.asp?FileID=826
Peter
1. Add new parameter into the function and save a codeunit.
2. Goto a Object Designer and compile a project.
Nav, T-SQL.
Thank you for your post. The problem is that I should check all the NAV objects where there is code (tables, forms, codeunits...): there too many objects to compile. Is it possible to compile all the objects in NAV together in a short way?
1. Rename your function to something unique: FunctionToBeFoundXYZ123
2. Export all NAV objects as text
3. Load this textfile in your texteditor (not notepad) and search for the text 'FunctionToBeFoundXYZ123'
Don't forget to rename your function back to the original name afterwards.
First of all you thereby delete the stored settings in all users ZUP files. If done in a Live enviroment, you get a lot of angry users :-)
If you do it in a Dev enviroment, you might overwrite work of other developers, if you have old objects in your object cache.
And finally. If you are missing any nessesary components used by any of the objects, then the object are left in an error-state (at least in NAV2013, don't remember in NAV2009).
I'm not saying it isn't a simple solution - just be carefull...
Peter
I did understand that I should be careful, but the problem misses because I have to manage a local and personal NAV database. The issue is another: how do I compile all the objects in a massive/mass way? Is there a specific functionality? I cannot compile thousand amd thousand of objects in entire NAV application becasue is too much time consuming. I hope that I explianed better my point.
Then go get a cup of coffee and when you come back all object with problems are either marked or in an error list (depending on which version you use). Copy the objects with errors to a spreadsheet, as you easily loose the list in NAV.
Peter
I tried to export all the objects as you suggested me, but Nav did not make it due to the following error message "Tabledata 55100 do not exist". I found an object with this number and this name, but I did not find it. Do you understand this erroe message?
in Italy we are happy to have a coffee, but...
(1) Does it work using NAV version 2009 R2?
(2) there are about 40 functions that I should rename in a specific codeunit (part of an add-on): the entire issue is to be sure that all the functions inside this codeunit are not called from any other object in all NAV. Should I just check where the codeunit "CodeUnitToFind" is present in the exported text file? Of course I can rename it.
Somewhere, there is an object which references table 55100, but that table does not exists. It's probably a form based on that missing table.
To find out which form it is you can compile all forms. If you don't want to do that, than export the first half of all form objects as text (eg. forms 1 ... 50000). If there is no error during export, then try exporting the 2nd half of all form objects (eg. forms 50001 ... 999999999999) . If there is an error, then export the first half of this 2nd half of objects (eg. 50001 ... 70000) etc.
If you don't want to do this, send me the database and 500 EUR and I'll find the object for you.
Dear pdj,
I tried to compile all the objects as you suggest me but the problem is that there are too many objects that are not possible to compile (F11 key). For instance also the specific codeunit (part of an add-on) where there are all the functions that I want to avoid shows the following error if I compile it: "Could not load the selected type library". The paradox is that al least 4 functions inside this codeunit work in production environment. Do you have any insights to go on focusing on my goal?
I found this compuile error: there is a variable that is "automation" type that has not the subtype. Unfortunately this point does not solve my issue.
You have a poorly maintained database, when you have objects refering to non-existing tables and maybe even other NAV objects. So do most companies - developers are lazy (and proud of it ). Now would be a good time to get these kinds of problems fixed.
So far you have been given 4 different suggestions:
1) Object Manager
2) Statical Prism (never tried this one, but it seems to be able to do the job as well)
3) Export in Txt format
4) Compile al objects
All of them does the job - you just need to work around the limitations when you have partly invalid objects.
Peter
I used 4th suggestion: I exported the critical codeunit, I saved it, afterwards I deleted it and finally I compile all the objects: I found the list of objects that defines that codeunit. Thank you.
As far as I understood and tried, it is not possible to export txt format if all the objects are not compiled.