You need to sign in to do that
Don't have an account?
Practise Data
if record gets deleted which name starts with A and start date = last month then it should get undeleted ??How to write a script Please help
Hii Team,
I need to write this trigger,If anyone can help it would be apreciated
It's urgent
I need to write this trigger,If anyone can help it would be apreciated
It's urgent
First of all I would like to suggest that insetead of restoring the record after deletion, have a validation in trigger in before delete if above condition is Satisfied the don't allow user to delete the record.
You can refer this in detail on below link :
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_context_variables.htm
Coming back to your Orignal question in case you already deleted the record and want to restore it.
After you have deleted records, the records are placed in the Recycle Bin for 15 days, after which they are permanently deleted. While the records are still in the Recycle Bin, you can restore them using the undelete operation. If you accidentally deleted some records that you want to keep, restore them from the Recycle Bin using below code.
You can read this in detail if you need any help on : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_dml_examples_undelete.htm
SImilar question is already answered on : https://salesforce.stackexchange.com/questions/107521/restoring-deleted-records-using-apex/107522
Please mark this as best answer if this helps.
Regards,
Santosh Kumar