Accessing a subform's edit form

Accessing a subform's edit form

Postby miketee » Thu May 05, 2016 1:08 pm

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.
miketee
 
Posts: 9
Joined: Thu May 05, 2016 12:55 pm

Re: Accessing a subform's edit form

Postby admin » Thu May 05, 2016 3:33 pm

admin
Site Admin
 
Posts: 3267
Joined: Mon Jun 15, 2009 9:53 am

Re: Accessing a subform's edit form

Postby miketee » Fri May 06, 2016 2:58 pm

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,
miketee
 
Posts: 9
Joined: Thu May 05, 2016 12:55 pm

Re: Accessing a subform's edit form

Postby admin » Thu May 12, 2016 3:26 pm

.
admin
Site Admin
 
Posts: 3267
Joined: Mon Jun 15, 2009 9:53 am


Return to General