How to implement a button function in Ninox: Create a new record and pop it up?
Hello everyone, can the button function in the HOME table be modified to: create a new record and pop it up?
For someone like me who is just getting familiar with Ninox functions, HTML seems to be another profound subject. Thank you for your help!
Ninox :
let aa := this;
let newJl := (create 'ADD');
popupRecord(newJl)
19 replies
-
Does your code not work?
-
Try this code in a button:
popupRecord(create ADD)
-
There is a trick to do this by using a hidden field where the code is in the trigger after update to create a new record and open it. I have updated your database with an example of this:
Notes:
1) make sure the name of the hidden field does not contain spaces or special signs in order to let the function fieldId() to work correctly.2) change the binding of the hidden field to "Per record in memory (browser)" to let this work.
-
Hi, I've tried another approach by combining 'database.create' and 'ui.popupRecord':
let x := tableId("ADD"); let y := x + (number(last(select ADD)) + 1); html(" <head> <style> .szButton { border: 1px solid #566eb1; color: #566eb1; background-color: transparent; padding: 2px 20px; font-size: 14px; border-radius: 4px; cursor: pointer; text-align: center; } </style> </head> <body> <button class='szButton' onclick='createAndPopup()'>Create & Open</button> <script> function createAndPopup() { database.create('" + x + "'); ui.popupRecord('" + y + "'); }; </script> </body>")
Content aside
- Status Answered
- 11 days agoLast active
- 19Replies
- 109Views
-
6
Following