In my example, I have a questionnaire, and a list of potential questions. User can build the questionnaire by joining the pre-built questions to the questionnaire using this junction object (questionnaire item).
So obviously re-using the questions saves the user work, but the process of adding questions is kinda clunky.
- Click on the Add Questionnaire Item button
- Click on the lookup dialog button
- Search Question Texts (hopefully you know them all by heart!)
- Save
- Repeat--for maybe a few dozen questions?
So what I made was a visualforce page to list all the optional questions, check their boxes, and then hit the add button.
###New Version see the page called MassChildJunctionAddParameterized
###Older Version (see the page called MassChildJunctionAdd)
For nicety, I did these using some of the standard VF components (pageblock, buttons, etc). You probably won't want to do that if your intent is to do this in the Salesforce1 mobile app.
All the code is on github. I used angularJS, connected to Salesforce by a lovely package called ngforce written by MVP Kevin Poorman. My github repo contains a packaged-up-version of ngforce saved as a static resource if you'd like to play with it quickly.
To load the page, there's a custom button I added
You can then drop it onto the questionnaire (original parent) layout. It takes the recordId from the questionnaire which is then used to populate the children.