You need to sign in to do that
Don't have an account?
Shivani Bankar
passing master data to detail object on vf page
hello,
I want to create wizard such a that, I'm having two object with master detail relationship
on first VF page master object's data is inserted and when we Click on save button Detail object VF page should open with Master Object's name already inserted on it
I want to create wizard such a that, I'm having two object with master detail relationship
on first VF page master object's data is inserted and when we Click on save button Detail object VF page should open with Master Object's name already inserted on it
If this solves your problem, please mark it as best answer/solved.
You can do this by the following approach below
1. In your first vf page in save call controller method u must be inserting master data after inserting u will know about the id of that inserted record so that when u redirect to the next detail VF page append this is in query parameter like for ex- https://saketorg-dev-ed--econtacts.ap5.visual.force.com/apex/DetailVFPage?Id=YOUR MASTER RECORD ID.
2. In detail VF page in constructor u can get the Id of the the master by this code snippet
Id masterId = ApexPages.currentPage().getParameters().get('Id');
3. After retrieving Id query the Master to retrieve the information u want to display in vf.
I think this will solve ur problem, if u still have any problem please let me know.
Thanks
Saket Sharma