10

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

null
    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view

    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.

    • Alan_Cooke
    • 1 yr 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

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      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.

    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view

    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.

      • Fred
      • 1 yr ago
      • Reported - view

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

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      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 😅

      • Fred
      • 1 yr ago
      • Reported - view

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

    • cdammert
    • 1 yr 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

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      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
      • 1 yr 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.

      • Fred
      • 1 yr 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)
      
      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      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?

      • cdammert
      • 1 yr 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! 🙏 

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

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

      • Fred
      • 1 yr ago
      • Reported - view

      Jacques TUR It works now.

    • Oliver
    • 1 yr 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?

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      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.

    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view

    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 😁

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      Jacques TUR Hi Jacques where can I find the FieldInspector (versión 2.1.4)

      Thanks

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Rafael here : https://forum.ninox.com/t/p8h78zv?r=g9ha3vf

      add option codeFinder : true if you want : https://forum.ninox.com/t/p8h78zv?r=q6halqg

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      Jacques TUR Thanks Jacques 

    • Fred
    • 1 yr ago
    • Reported - view

    When I tried it on a 10.3” iPad with 16.3.1 using Firefox. I get the following empty drop down menus:

      • Fred
      • 1 yr ago
      • Reported - view

      it works fine in the MacOS browser.

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Fred Thanks a lot Fred. Dealing with this problem is not easy for me as I don't have any debugging tools on the iPad. 
      I have also seen that it is not possible to move the inspector window with the finger or pen either.  All this makes FieldInspector unusable on Ipad and iPhone for the moment.
      I hope to get it to work a bit better at some point.

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Jacques TUR I finally found some debugging tools on Ipad. I updated Ninext (ver 2.1.5) and now the lists display correctly on Ipad and iPhone and you can move and resize the popup with a stylus or your finger:

Content aside

  • 10 Likes
  • 1 yr agoLast active
  • 56Replies
  • 997Views
  • 18 Following