You need to sign in to do that
Don't have an account?
Ankit Garg 117
Clone custom object while cloning the opportunity
HI,
We have a custom object called ''Banner''. Whenever a user creates an opportunity, they add a banner to that opportunity. Now, whenever a user closes an opportunity, they clone it and name it ''Renewal (opportunity Name). This way they have created another opportunity for the same business to sell them again in future.
Now, when they clone the opportunity, the Banner details don't get cloned so they have to add the Banners again. Some opps have 10+ Banners so they have to add them again. Banner is shown as a related list on the opportunity page. How can I get Banners to be cloned with all the information when they clone an opportunity? Can someone please help me with the trigger to achieve this?
Thanks
We have a custom object called ''Banner''. Whenever a user creates an opportunity, they add a banner to that opportunity. Now, whenever a user closes an opportunity, they clone it and name it ''Renewal (opportunity Name). This way they have created another opportunity for the same business to sell them again in future.
Now, when they clone the opportunity, the Banner details don't get cloned so they have to add the Banners again. Some opps have 10+ Banners so they have to add them again. Banner is shown as a related list on the opportunity page. How can I get Banners to be cloned with all the information when they clone an opportunity? Can someone please help me with the trigger to achieve this?
Thanks
Hi Ankit Garg 117,
here below I have made your solution for cloning.
TriggerHelper Class
Trigger
Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful.
Thank You,
Malika Pathak
All Answers
https://trailblazer.salesforce.com/ideaView?id=08730000000BpUXAA0
If it helps mark this as the best answer.
Hi Ankit Garg 117,
here below I have made your solution for cloning.
TriggerHelper Class
Trigger
Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful.
Thank You,
Malika Pathak
Thank you so very much for this. Do I need to go to Developer Console -> File -> New -> Aspex Class and then past the first section of the code there and then Developer Console -> File -> New -> Apex Trigger and paste the second part of the code?
Regards
yes....!!
There are few errors on the first code when I copy pasted. Are there any changes that I need to make in the first code?