The data is a bit complex in parts so I'll lay it out this way:

We have Custom Object A; this is the lowest object in a tier set of them.

We have Custom Object B; this is the highest object, and meant to be a container of sorts for ObjectA.

We have ManyToMany Object C; this is a many to many object between B and A so that B can contain any number of Object A.

The New button for ObjectC has been overridden with a visualforce page that lists all of the different pieces of data for ObjectA, and will let users add many records into ObjectC at once, similar to how Products can be added in Opportunities.

And we have a new Visualforce page that will override viewing ObjectB.

Is there a way from the Visualforce page for ObjectB, create a new record for ObjectB and then call the new function from ObjectC where the new ObjectB would be carried over?

  • do the VF pages for Objects B and C each have VF controllers? If yes, you have all the control you need by B's controller, upon Save of new record, redirects to VF page for C passing a query parm of B's ID. The VF controller for C uses that query parm to initialize B's values via SOQL before presenting the C page to the user – cropredy Apr 17 '15 at 2:12
  • Your question is entirely too cryptic. Try using a concrete example and a specific scenario. If necessary, provide as much relevant code as possible. DML cannot be done on page load so there must be some user action but I am unclear on exactly what you are trying to accomplish. It is entirely possible to bring over a related object or an entire set of objects when creating a new record. You can also bring cloned versions over. Take a small part of your problem and give a sample scenario – Chris Apr 17 '15 at 2:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.