8

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!

42replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • 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.

    Like 3
    • Alan Cooke
    • Alan_Cooke
    • 3 mths ago
    • Reported - view

    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

    Like
    • dear Alan Cooke difficult to answer you because, yesterday I did not change anything. The only update I did was today, 1 hour ago.

      On the other hand, I don't use a window to initialize the code anymore. I use the dialog function (see here for more explanation). It is much easier to implement and maybe it can solve your problem.

      You can also send me a sample chart so I can see what is going on and fix the problem.

      Like
  • 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.

    Like 1
      • Fred
      • Fred
      • 3 mths ago
      • Reported - view

      Jacques TUR Nice! That is a quite an impressive update.

      Like
    • Fred It's just that I'm lazy and I was tired of having to open and close all these windows. It made me lose my train of thought when I was looking for a bug 😅

      Like 1
      • Fred
      • Fred
      • 3 mths ago
      • Reported - view

      Jacques TUR You are a funny man, Jacques. Oh and a pretty good programmer to boot.

      Like
    • cdammert
    • cdammert
    • 3 mths ago
    • Reported - view

    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

    Like
    • cdammert Thank you for your message 👍

      Thank you for your message 

      I can't reproduce the problem. I would like to understand the cause of it. Please let me know where you put the initialization code on your database, what plateform you are using (application, public cloud, private cloud..) and the version of Ninox? 
      If you send me a sample database, that would be even better.

      Also, I am attaching an example of a database that works on Safari in public cloud version 3.7.8

      • cdammert
      • cdammert
      • 3 mths ago
      • Reported - view

      Jacques TUR Same with your sample database, both in the Mac app (v3.7.8) and Safari (Ninox v3.7.9, Safari 14.1.1), public cloud, macOS 11.4. The dialog window is saying exactly the same as my screenshot above.

      Fun fact: Your sample database works and loads exFieldsInspector 1.0.8 beta perfectly in Chrome (v 107.0.5304.87) and Firefox (v 106.0.3) on the same Mac.

      Like
      • Fred
      • Fred
      • 3 mths ago
      • Reported - view

      I get the same error with NativeJS to Forum DB. I'm on MacOS app 3.7.7.

      I have this in a formula field in another DB and it loads fine:

      var configLoadModules := {
              completion: false,
              badges: true,
              evalJS: true,
              viewEvent: true,
              buttonEvent: true,
              fieldsInspector: true
          };
      html(http("GET", "https://raw.githubusercontent.com/JacquesTur/Ninext/main/loadModules.html").result)
      
      Like
    • Fred & cdammert : It's strange because I can't reproduce the problem on my Mac with the app or the web 🤔 !!!???
      I'm trying to modify the code corresponding to the error message. Can you test if it works now?

      Like
      • cdammert
      • cdammert
      • 3 mths ago
      • Reported - view

      Jacques TUR It works, both in the Mac app and Safari. But I also used the time and updated macOS and Safari to their latest versions supported on my machine (macOS 11.7.1 vs. 11.4 before, and Safari 16.1 vs. 14.1.1 before). So not sure what actually caused the problem, but I guess it was my outdated operating system.

      Merci beaucoup for your swift reply and support! 🙏 

      Like
    • cdammert I'am trying to test previous version of FieldsInscpector with last version of MacOS (ventura). 

      Like
      • Fred
      • Fred
      • 3 mths ago
      • Reported - view

      Jacques TUR It works now.

      Like
    • Oliver
    • Oliver
    • 1 mth ago
    • Reported - view

    this tool is absolutely top notch
    I've been waiting for a feature like this for years
    where can I donate something for this?

    Like
    • Oliver Thank you very much 🙏.
      I haven't actually organized it yet. Maybe I could put a hat on the floor ? 🎩😁

      I'm planning to professionalize Ninext, especially by making agreements with Ninox to ensure the sustainability of the developments. Right now, my other jobs are taking up too much of my time to do that. I prefer to keep the time I have left to continue to build Ninext as I planned, but also all the good ideas that each of you brings to me as I go along.

      Like 2
Like8 Follow
  • 8 Likes
  • 1 mth agoLast active
  • 42Replies
  • 496Views
  • 16 Following