Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Subform Type Form

admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Subform Type Form

Unread post by admin »

Ben,

There is no easy way.

If you only have one record, I'm not sure why you're using a subform. If this extra info needs to be kept in another record, you could put those fields on the main Form and update them on After Save.

Subforms are really for one to many relationships.

Steven
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Subform Type Form

Unread post by admin »

Ben,

You could try this in the JavaScript as the Form loads..

Code: Select all


var i = 'subform_name';

document.getElementById(i + '_subform0000_nuRow').setAttribute('onclick','')

Steve
BenFranske
Posts: 13
Joined: Fri Feb 07, 2014 10:54 pm

Re: Subform Type Form

Unread post by BenFranske »

admin wrote:Subforms are really for one to many relationships.
Oh I realize that. In this case it's because the data in the subform will (in most but not all) cases entered automatically through a batch process which may occur before and may occur after the manual data entry takes place. I didn't want to place the fields in the main table because if the automatic batch job occurs before the manual data entry they would need to edit an existing record instead of creating a new one. In other words they would have to search through the records and determine if the batch job has already created a record to edit or if they should make a new record.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Subform Type Form

Unread post by admin »

Ben,

Let me know if the function above does what you want, and I'll close this post

Steven
BenFranske
Posts: 13
Joined: Fri Feb 07, 2014 10:54 pm

Re: Subform Type Form

Unread post by BenFranske »

You were very close and put me on the right trail to dig around further but instead of:

Code: Select all

var i = 'subform_name';

document.getElementById(i + '_subform0000_nuRow').setAttribute('onclick','')
I needed to make it:

Code: Select all

var i = 'msm_operations_sales';
document.getElementById(i + '_subform0000_nuRow').setAttribute('onclick','');
document.getElementById(i + '_subform0000_nuRow').setAttribute('onkeypress','');
Note that this did break the actual saving of data from the subform though so I still need to dig around some more.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Subform Type Form

Unread post by admin »

.
Locked