In the video you linked there is an edit button for the contact. How does that work???
Edit button (with onclick) or the "ATTM - File name" display field (with onfocus) makes exactly the same thing so starting with the basic code of display field:
Code: Select all
if (nuFORM.edited) {return;} var f=nuSubformValue(this, 'con_rap'); if (f!=='') {nuForm('5d5fbf488ceedd4',f,'','');}
Do nothing if form is during edit:
read the current record ID of the "contact" table / the line from the subform on which you clicked / so in this case it reads the lookup value and this value is in fact ID of the contact table to that specific record.
Code: Select all
var f=nuSubformValue(this, 'con_rap');
next if value is not empty - it open the contact form in edit form on which only this specific record is displayed.
Code: Select all
if (f!=='') {nuForm('5d5fbf488ceedd4',f,'','');}
the value from example 5d5fbf488ceedd4 is the Contact Form ID - you can get this value with nuCurrentProperties() - but make sure that the proper form is focused in the browser - especially if you use the run/iframes.
https://wiki.nubuilder.cloud/ ... ipt#nuForm
Przechwytywanie.JPG
For the edit button I added the hide and show option to avoid double click on the button - double click can force to execute the code twice - so I always protect all buttons from double click. You can do it with hide/show or disable/enable.