You need to sign in to do that
Don't have an account?

Button to pull data from fields in parent case
Hello,
I am new to APEX and was hoping someone could help me. I am looking to create a class for a button on the case object. I would like the button to be placed on child cases and retrieve data from certain fields from the parent case.
I recently created a class for a button on the parent case that will create new child cases and pre-populate certain fields but am not sure how to reverse-engineer my solution for the use case described above.
Can someone please help me write this class or help me write the foundation?
Thanks in advanced.
I am new to APEX and was hoping someone could help me. I am looking to create a class for a button on the case object. I would like the button to be placed on child cases and retrieve data from certain fields from the parent case.
I recently created a class for a button on the parent case that will create new child cases and pre-populate certain fields but am not sure how to reverse-engineer my solution for the use case described above.
Can someone please help me write this class or help me write the foundation?
Thanks in advanced.
Try below code :-
All Answers
If this helps,please mark it as best answer to help others :)
I gave you the sample code earlier.I have wrapped it in a Trigger,please try below code for Trigger :-
If this helps,please mark it as best answer to help others :)
Sorry if my questions are rudementary.
Thanks!
Try below code :-
The code works well except it updates the child cases everytime it is edited if any of the field values change on the parent case. That is why I was looking for a button so it would only update when the user selected it on the child case. Is that something you could accomplish?
Thanks!