You need to sign in to do that
Don't have an account?
Steve Connelly
How do I delete records with a trigger?
I have an apex trigger the creates custom object records from an opportunity when the opp is ceated or when the close date is updated.
So far so good.
I have a new wrinkle and I am not sure how to apprach it.
When the opp close date is updated, I need the trigger to delete any of the custom object records it created in the earlier pass and then create new ones as normal.
Any suggestions on how to come at this?
Thanks much,
Steve
So far so good.
I have a new wrinkle and I am not sure how to apprach it.
When the opp close date is updated, I need the trigger to delete any of the custom object records it created in the earlier pass and then create new ones as normal.
Any suggestions on how to come at this?
Thanks much,
Steve
Greetings!
You can use the below sample code to delete the records as per your business logic.
https://developer.salesforce.com/forums/?id=906F000000090XGIAY
https://developer.salesforce.com/forums/?id=906F000000090XGIAY
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
All Answers
Greetings!
You can use the below sample code to delete the records as per your business logic.
https://developer.salesforce.com/forums/?id=906F000000090XGIAY
https://developer.salesforce.com/forums/?id=906F000000090XGIAY
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
Steve