0

Triggers and table conditionals limitations in Local/Cloud

Hello. I am on the Starter subscription and I found two problems:

The same Trigger on create that works in any workspace (cloud) does NOT work in local (in MacBook app).

The Createtable if and Deletetable if options are available only in local (in MacBook app) but are NOT available in any workspace (cloud).

Are these limitations normal in Starter subscription? The first one forces me to create databases in cloud that I would prefer to create in local; the second one forces me to create databases in local that I would prefer to create on cloud and in which I will NOT be able to use Createtable if and Deletetable if.

Thank you.

Claudio

10 replies

null
    • Fred
    • 3 mths ago
    • Reported - view

    Here is the official word on those permissions. There shouldn't be any difference between apps and not mention of subscription level. I guess I would want to know what your code is for the ifs.

      • cor
      • 3 mths ago
      • Reported - view

       Thank you, Fred, for your reply. My description is literal and I have tried it in several times: exactly the same triggers work perfectly on cloud and do not work in local; and Createtable if and Deletetable if are simply not available when I am working on cloud (where it is not possible to introduce any code in these fields).

      In the attached file, the table 'Sesiones' has this Trigger on create:

      let sesion := 'Nr.';
      let grupo := Grupos;
      let gruposPersonas := (select 'Grupos-Personas' where Grupos = grupo);
      for persona in gruposPersonas do
          let nuevaAsistencia := (create Asistencia);
          nuevaAsistencia.(
              'Grupos-Personas' := persona;
              Sesiones := sesion
          )
      end
      

      In my Ninox app in MacBook:

      • Triggers: If I import the database in a workspace, it works perfectly; if I import the database in local space, it does not work.
      • Table conditionals: If I import the database in a workspace, I can not edit Createtable/Deletetable ifs; if I import the database in local space, I can do it and it works perfectly.

      I will thank any answer about these limitations.

      Claudio

      • Fred
      • 3 mths ago
      • Reported - view

      I was able to add isInAdmin() to Creatable if, both local and web, and it worked fine.

      I have v3.12.2 MacApp and the latest for the web. I am in the Pro subscription (😫).

      What is your code for the Creatable?

      • cor
      • 3 mths ago
      • Reported - view

       So we have now one answer and still the same other question:

      ✅ Createtable if and Deletetable if: These options are available only in Pro subscription. With Standard subscription, I can use these fields in local space, but not in cloud workspaces, because these conditionals have their authentic sense in collaborative workspaces with role-base access permissions (so I can use Createtable if and Deletetable if in local but it is almost not useful to do it).

      ❓ What about the trigger on create I mentioned in the attached file (when you add a row in 'Sesiones', some rows are added in 'Asistencia' automatically)? Could you try that, please? If I import the database in a workspace, the trigger works perfectly; if I import the database in local space (out of cloud), it does not work.

      Than you so much.

      Claudio

    • Fred
    • 3 mths ago
    • Reported - view
     said:
    These options are available only in Pro subscription.

    I missed this part of their website:

    So yeah, Starter does not have Role-based access permissions.

    What about the trigger on create I mentioned in the attached file

    So I was able to reproduce it. You should let Ninox know about it.

    One work around could be to create a button in Grupos with the following bit of code:

    let grupo := this;
    let gruposPersonas := 'Grupos-Personas';
    let nuevaSesion := (create Sesiones);
    nuevaSesion.(Grupos := grupo);
    for persona in gruposPersonas do
        let nuevaAsistencia := (create Asistencia);
        nuevaAsistencia.(
            'Grupos-Personas' := persona;
            Sesiones := nuevaSesion
        )
    end
    

    Line 2, I switched out the select command and used the reference link you already had.

    Line 3, I added a create() command to make the new Sesiones record.

    Line 4, Linked the new Sesiones record to the current Grupos record.

    Line 9, modified the Sesiones link in Asistencia to the newly created Sesiones

    Another way to go about this is to create a user input dashboard. Now you can add Sesiones data as you create the record.

      • cor
      • 3 mths ago
      • Reported - view

       Thank you again for all your attention and help. I will use buttons instead of triggers if I need a "trigger" in a local database. But triggers must work too, so I will inform to Ninox as you recommended.

      It appears to be different bugs/limitations when working in local. Recently, I have checked that pages do not work properly in local and work perfectly in cloud workspaces (again: using exactly the same database). Some bothers that I will end avoiding by working always on cloud, what is other bother for me in some cases.

      I will mark the topic as answered:

      ℹ️ Role-based access permissions are not available in Starter subscription and this also seems to affect to the fields Createtable if and Deletetable if (which are not available in workspaces with a Starter subscription). The fact we can use these fields in local databases (non collaborative space) is like a "present" from Ninox, almost useless precisely out of collaborative cloud.

      ℹ️ Some triggers do not seem to work in local databases; they work only in cloud workspaces. And I will ask Ninox for this bug/restriction and other ones recently detected, like pages working wrong in local databases.

      ✅ Provisional solution: Working always in cloud workspaces and accept the limitations of Starter subscription.

      Thank you so much. Best regards.

      • Fred
      • 3 mths ago
      • Reported - view

      Yes, the pages issue is old. But go ahead and tell them. The more the merrier. Just don't expect Ninox to tell you when they fix something. You just have to remember to test it out in new versions.

      The variation between app and cloud is why I switched to cloud.

    • cor
    • 2 mths ago
    • Reported - view

    Hello again:

    I think I found the reason why some triggers do not work in local databases but they work perfectly in cloud workspaces. The key seems to be the way in which new records are created or, in other words, the relative order between "creation of a new record creation" and "starting of the trigger on new record" in the insides of Ninox engine. I am guessing the following:

    • In cloud workspaces, new records are automatically filled with linked information from other tables, if it is the case. When I create a row in 'Sesiones' subtable from 'Grupos' parent table, that new row in the subtable has the field 'Grupo' automatically filled with the information from the parent table. The same happens in 'Grupo-Personas' subtable: when I create a new row in 'Grupo-Personas' subtable from 'Grupos' parent table, that new row in the subtable has the field 'Grupo' automatically filled with the information from the parent table. Therefore, I can use a trigger including that fields ('Grupo', in this case) that are automatically filled BEFORE starting the trigger. And it works perfectly.
    • In local, new records are NOT automatically filled with that linked information from parent tables. That is why the triggers which include that fields do NOT work at all. In other words: when I create a row in 'Sesiones' subtable or in 'Grupo-Personas' subtable, that fields are filled AFTER finishing the trigger, so the trigger does not have the required information to work properly. Indeed, this explains that the same code do NOT WORK in a "trigger on new record" but WORKS perfectly in a "trigger after update" or as a button action (in these both cases, the new record is completely created when the code is called).

    If my supposition if true, problems with "triggers" in "local" databases could be solved by fixing something in Ninox local engine. I hope Ninox team will do it in future updates. Until that, I will work with buttons.

    Best regards.

    Claudio

    • Fred
    • 2 mths ago
    • Reported - view
     said:
    In local, new records are NOT automatically filled with that linked information from parent tables.

     I'm not sure I understand this part.

    If I'm on MacOS app with local DB. I open the Grupos table, then click on Create Record below Sesiones, I get a new Sesiones record that is automatically linked to the current Grupos record. I do agree that there seems to be a problem on the app side with local DB not being able to access the reference field, but the link is made.

      • cor
      • 2 mths ago
      • Reported - view

       I agree with you. The link is made (the child record is associated with the parent record), but, for some reason, the field seems empty when the trigger tries to get the information 🤷‍♂️

Content aside

  • Status Answered
  • 2 mths agoLast active
  • 10Replies
  • 85Views
  • 2 Following