+ Start a Discussion

Need a custom button on related list to select & add multiple existing records to this related list. How to achieve this using VF page?


Just edit layout for parent object.

You have to go to that related list section and hit "Related list properties" button and expand buttons box and check "New" standard button to be displayed on related list

Related list shows only those records which have a relation to the record where this related list is displayed on the detail page.

Do you wish to have a button form where you can create a relation between two records?

Sorry I am not quite sure what the requriement is..cud you pls elaborate..

can u help me by providing the vf page code to acheive this? thanks
yes I have lookup on a custom object(books) to opportunity.now from the related list on opportunity I need to select & relate multiple existing records of custom object to opportunity. I need the vf page code to achieve this so that I can add custom button to the related list which open ups this vf page. thanks.
Hi Vishnu,

Not the exact code but I've thought through the solution and following is what you can try:
On the VF page
1)Create a wrapper class which pulls up the existing Books which are not related to this opportunity in a form of a list with checkboxes
2)Associate all the selected Books to the Opportunity in the detail page.

code for reference: