Page 1 of 1

Accessing a subform's edit form

PostPosted: Thu May 05, 2016 1:08 pm
by miketee
I have an edit form with several subforms.
From this edit form is it possible to directly open the edit form of one of the subforms by clicking on an existing subform row?
ie for the subform to behave much like a browse form.

Re: Accessing a subform's edit form

PostPosted: Thu May 05, 2016 3:33 pm
by admin

Re: Accessing a subform's edit form

PostPosted: Fri May 06, 2016 2:58 pm
by miketee
Thanks Steven for the rapid reply. That reference was very helpful, and I now have the subform's edit form opening nicely when I press a button in a subform row.
To summarise what was required to get this running:

1. Added a boolean field to the subform's table. (Could not see how else to get the button into the subform)
2. Created a new subform for this table including the bool field , which I then set to button type
3. Attached an onclick event to this button field, set to execute a custom javascript function:
openContactsForm(this);
4. Placed the javascript function code into the Custom code -> Javascript tab of the main edit form (ie the form containing the subform)

function openContactsForm(t) {
var id = $('#' + nuRowPrefix(t) + '_nuPrimaryKey').val();
nuOpenFormInFrame('572bd28d73a2faf', id);
}

The value '572bd28d73a2faf' was found by looking up the field zzzsys_form_id for the form I wanted to open, in the zzzsys_form table. (Not sure if there is a nuBuilder function to do this)

Cheers,

Re: Accessing a subform's edit form

PostPosted: Thu May 12, 2016 3:26 pm
by admin
.