Page 1 of 1

Related fields on new record

PostPosted: Fri Mar 23, 2012 8:07 am
by wisni1rr
I was wondering how I could add related fields to the new/edit record screen? I understand that I can do this with widget:type=grid fields to an extent. I want to have my related field appear as it was just an extension of the first table.

Can anyone lead me on the path to finding this answer?

Thanks a lot!

Re: Related fields on new record

PostPosted: Fri Mar 23, 2012 12:35 pm
by shannah
Currently there's no automatic way to do this. This will be a new feature in 2.0 when it is released (as part of the ajax_form module) that is currently in development.

You could sort of simulate this with transient fields then use the afterInsert() or afterSave() trigger to add them to the related record.

Re: Related fields on new record

PostPosted: Fri Mar 23, 2012 3:12 pm
by wisni1rr
Thanks, Steve!

If its not asking too much, can you give a small example.

From the sound of it, this would work. It also seems like the record would be missing when loading the record for an edit situation. Is there a way to pull the values with an ON LOAD style event to place the data in the transiet field. Maybe I'm over thinking this...

Your help is always appriciated!