Activity Forums Salesforce® Discussions Custom list button to add existing records in a related list

  • Naman

    Member
    April 30, 2016 at 5:34 pm

    I have 1 custom object "Loan__c" with master-detail relationship to Account (used for loan of equipments).
    I am planning to use the Asset object to manage my stock of loan equipments.
    I created a custum field "LoanRef__c" into Asset with look-up relationship to the Loan__c object.

    I have a related list "Assets" in the "Loan__c" object - I'd like to add a custom list button there to add existing asset records to this loan. When clicked, the list of all existing asset records must be shown with ability to check the ones I want to add to the loan.

    I guess I need to develop an apex class + visualforce page.
    I'm a novice with apex and visual force but I tried to adapt some similar codes found on the forum, with no success.

  • Prakhar

    Member
    June 13, 2016 at 12:14 pm

    Hii Naman,

    That's right you will have to use an apex class and vf page to display and add the records to the related list of the Assets on selecting the records.

    You will have to override the custom list button with the vf page that you will be creating to display the records. In that vf page with the help of wrapper class and add button you will then be able to add the records to the related list.

    Hope that helps.

    Thanks.

Viewing 1 - 2 of 2 posts

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos