Hi Praveen, I am making an after undelete trigger for restoring the records on the same position as it was on before deleting & for that I need the old value of a sequence number field(custom field). I have a custom number field which I am incrementing sequentially using insert trigger. Suppose I have 5 records who're having sequence num 1,2,3,4,5 and now if I delete one record(say 3) I rearranged the list to 1,2,3,4 using the delete trigger but now if i want to restore it back to the same position after undelete what should I do plz help...
We cannot get the old values in undelete context.
Undelete event just restores the deleted record. Also, the id of the record remains the same after it is restored.
Please find the below reference link for the same.
https://developer.salesforce.com/forums/?id=9060G0000005oDfQAI
If this solution helps, Please mark it as best answer.
Thanks,