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

Login in Apex Trigger
Hi All,
Is it possible to login with another user in Apex Trigger.
My Use Case:
I want to deleting Account in UPDATE trigger based on some conditions. But when account get deleted, it will be available in SFDC Recycle bin of that User. I want to hide that record from recycle bin of that user.
So i am thinking of, before deleting, i will login with some dummy user and perform the delete operation. So that deleted record will be available to the dummy user's recycle bin.
Or is there any function available to clear SFDC recycle bin from Apex?
Any help on this would be appreciated.
Thanks
V.R.
Is it possible to login with another user in Apex Trigger.
My Use Case:
I want to deleting Account in UPDATE trigger based on some conditions. But when account get deleted, it will be available in SFDC Recycle bin of that User. I want to hide that record from recycle bin of that user.
So i am thinking of, before deleting, i will login with some dummy user and perform the delete operation. So that deleted record will be available to the dummy user's recycle bin.
Or is there any function available to clear SFDC recycle bin from Apex?
Any help on this would be appreciated.
Thanks
V.R.
you can also add a "before undelete" trigger and prevent an undelete from occuring on that record.