function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Requirement for popup a window and to enter the details.

HI i have a requirement.
i have 2 objects object A and object B object B is the master object and object A is child. on object B i need to create a custom button, onclick the custom button i need to popup a visualforce page we have fields along with save button . on entering the fields and on clicking the SAVE button the fields should get updated on the object A fields.

please let me know how to do it.. 

thanks in advance..
Adnubis LLCAdnubis LLC
You are going to want to take advantage of the StandardController to make this functionality work. Create your VF page and make sure it is using Object B as the standardcontroller. When you create a custom button on that object you will see your VF page as an option. See image below.

User-added image

You will want to create an extension class as well so that you can add your own logic to the page. See the link below for more details on how to create an extension.

In the extension you will need logic that will query the Children Objects (Object A) that you want to update. You will include properties in your extension to collect the information from the person filling out the form that is going to be put on the Object A. Once the user is done you can provide them a save button that when pushed will update any Object A records with the details that the user just filled out and then do an update on the Object A records and include some javascript to close the window. 

This is the direction that I would go with your project. Let me know if you need further help or questions.

Yes i got the complete before posting it but i couldnot able to close the window after saving it.
As i clicked on SAVE() button it should save the record and the window to be closed.