+ Start a Discussion

On click custom button create new 12 records on other custom object.

Please help me out
I have 3 custom object Employee, Payment & Proposal.
Payment have lookup with Employee.
Proposal have lookup with Employee.
Proposal has Year_package__c & From_Date__c custom fileds.

I want to create a custom button(Create Payments) on Proposal detail page.
On click of Create_Payements__c button it will create 12 new record on Payment (Custom obj.) for that Employee.
On Payement The 12 record will be Name like Jan 2020,Feb2020 and so on(as per From_Date__c on Proposal object).
How do I code for it on Custom button??????

Thanks in advance
ShirishaShirisha (Salesforce Developers) 
Hi Anita,


Please find the sample code to create the child record using VF page button from the Parent:


Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Hii Shirisha,

Thanks for replying me!
But  not really for working me.
Shamsher SinghShamsher Singh
@Anitha Sodhi : What have you tried here?