You need to sign in to do that
Don't have an account?
leanne zhang03177320069719939
Visualforce page: Insert a Parent object and related Children objects
Hi there,
I would like to create a visualforce page that saves a single Master Opportunity with multiple Child Opportunties (Child Opportunities fields will be the same from the Master Opportunities except Account and Amount where the user can enter manually on the visualforce page). When the user clicks on "Save" on the visualforce page, it should insert the Master Opportunity and also related Child Opportunities.
I have set up my data model. I'm using standard Opportuntiy as Child Opportunity, and has a look up field to Master Opportunity. Master Opportunitiy is a customer object which has the same fields as standard Opportunity.
I need help with the logic (controller) and I'm wondering if I could get helped on pointing in the right direction. I am thinking that in order to save Child Opportunities, the Master Opportunities should be inserted first, so that we can get the ID of the master opportunities and related to fields to save for the child opportunities.
Thanks so much,
LZ
I would like to create a visualforce page that saves a single Master Opportunity with multiple Child Opportunties (Child Opportunities fields will be the same from the Master Opportunities except Account and Amount where the user can enter manually on the visualforce page). When the user clicks on "Save" on the visualforce page, it should insert the Master Opportunity and also related Child Opportunities.
I have set up my data model. I'm using standard Opportuntiy as Child Opportunity, and has a look up field to Master Opportunity. Master Opportunitiy is a customer object which has the same fields as standard Opportunity.
I need help with the logic (controller) and I'm wondering if I could get helped on pointing in the right direction. I am thinking that in order to save Child Opportunities, the Master Opportunities should be inserted first, so that we can get the ID of the master opportunities and related to fields to save for the child opportunities.
Thanks so much,
LZ
If you need code, please post your VF code and I can give you the controller code based on that.