Ninext : Fields inspector (evaluate the impact of changing/deleting a field before to do)
Hello everyone,
Have you ever had a cold sweat before deleting a field in a table ? I always wonder what will happen. And the more my database is important, the more I'm afraid to have calculations that are no longer done or displays that are missing.
To try to solve this, I have developed an interface that allows you to see to which part of the code or the display the fields are connected.
This new module of the Ninext project adds badges next to the field names when they are used in other tables or views:
The number indicates how many codes use the field. The color indicates if it is a display code (green), a calculation code to make another field visible or to calculate the values of a column in a list (orange) or if it is used in a formula or to update other fields as in AfterUpdate (red).
By clicking on the badge you can see all the codes that use the field:
And if you click on the lines, you can see the corresponding code. The field is displayed in bold in the code to be more visible:
This popup remains on the screen until you close it. This allows you to open the different codes that are in other fields, tables or views while keeping the list of codes on the screen.
To add this functionality, simply include the code below in an HTML field that should be displayed when the database is opened:
var configLoadModules := {
completion: false,
badges: true,
evalJS: true,
viewEvent: true,
fieldsInspector: true
};
function afterLoadModules() do
if not isAdminMode() then closeRecord() end
end;
html(http("GET", "https://raw.githubusercontent.com/JacquesTur/Ninext/main/loadModules.html").result)
Copy
Copy
I am attaching a test database. Have fun!
56 replies
-
I just updated the field inspector to version 1.0.6 :
- - Automatic update of the inspector content when a field is modified. Thus, if the modification has an impact on the dependency links, it will be directly displayed. The update is done when the database is saved.
- - Ability to select a table and a field directly in the inspector, without having to open the field editing window.
-
I have had this installed for a while now. When I load my DB the init table opens and closes as it is supposed to. Then my MAIN MENU opens. Yesterday for some unkown reason the init table opens and stays open. I have to manually close it whereupon the MAIN MENU opens.
This is the code (never been changed apart from line 1) in the 'Trigger after open' option
-----
popupRecord(first(select init));
openTable("HOME", "MAIN MENU")
-----
Any explanation for this?
Jacques TUR -
In this latest version 1.0.6 of FiledsInspector, I have added the ability to open the edit window of the field or column that is in the list by clicking a button. The goal is to be able to easily follow the links between fields to, for example, correct some code.
The buttons simulate the user's action to close and open the windows. In cases where a confirmation of registration is requested, the buttons are grayed out so as to never validate or cancel a modification by inattention.
I hope this addition will make it easier for you to find and modify code in your database.
-
Hi Jacques
Fields Inspector is such a brilliant tool - thanks for developing and sharing. However, the module initialization seems to fail currently, see screenshot below. Is that a problem on my end or is there a bug in the module code?
Cheers,
Christoph
-
this tool is absolutely top notch
I've been waiting for a feature like this for years
where can I donate something for this? -
Hello everyone,
I've just updated FieldInspector (version 2.1.4 of Ninext) to add global functions and include TriggerAfterOpen in searches. So I renamed it "Fields & Fx".
You can now see all the dependencies of global functions. Among other things, this allows you to find all the code that uses a function before you modify or delete it.In addition, I have used the yellow highlighting in CodeFinder.
If a global function uses a field, you will also be able to see it in the list of field dependencies.
The next step will be to extend the search to codes that are in the reports. Until then, take advantage of its maintenance tools
-
When I tried it on a 10.3” iPad with 16.3.1 using Firefox. I get the following empty drop down menus:
Content aside
-
10
Likes
- 1 yr agoLast active
- 56Replies
- 1003Views
-
18
Following