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
-
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.
-
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.
-
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
-
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.
Content aside
- Status Answered
- 4 mths agoLast active
- 10Replies
- 87Views
-
2
Following