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

Profile should be reverted after 24 hrs
Team ,
I have a requirement .If a system admin is giving system admin access to another user ,then after 24 hours automaticaly it should be reverted back to original profile .
Can you give different approaches to achieve this .
Here is my analysis .
I am thinking trigger best suits here ,not a workflow since we need previous profile value to revert it back .
In trigger i was thinking how to revert the profile after 24 hrs .How can we schedule the time for the profile to revert the change (do we need to write apex class and schedule it thorugh scheduler .)
Please let me know your thoughts
Thanks,
Just in case if somebody is facing the same scenario .
The below solutions worked for me and successfully went to production'.
I have created 2 fields on User object and written a trigger to update a field and time trigger workflow to reset the profile after 24 hrs which inturn cals the trigger .
All Answers
As per my knowledge it is not possibel to exectue a trigger based on time ,it is sure that it will execute only when you will do any DML on the particular object .
Depends on you rrecordset you need to decide you will go for batch and schedule or not .
Is there any definite set of user which profile will change for 24 hours ? if yes then you can give some indentification ,
Is it a regular process that System admin will give SysAdmin access to those user daily or weekly or monthly once .If it is then you can go for batch and schedule .if more number of user then both batch and schedule or only schedule .
Another option we can use time based work flow to achive this we can create a date fileld which wil update the date when the user recor dwil update from other profile to systemadmin and based on that date field we can execute the WF to update the user profile after 24 hour .
Let me know if it helps ,For futher help please clarify your requirment .
Thanks
Manoj
Time based workflow does look good but i am concerned about getting the user profiles old profile so that once 24 hrs are passed i can revert it back from system administrator to original profile .
Old profile value you can get from formula filed ,while set the profile change date through field update action .and entry criteria you need to check that the formula field value which does not contain system administrator .
let me know if it helps !!
Thanks
Manoj
Thanks Manoj ,
This is how i gave the workflow rule whihc evaluates to formula .Profile date change i think i can rely on last update date .
But i didnt "Old profile value you can get from formula filed "
Can you send me the trigger rule and the action for the time trigger
Thanks,
Sailaja
Just in case if somebody is facing the same scenario .
The below solutions worked for me and successfully went to production'.
I have created 2 fields on User object and written a trigger to update a field and time trigger workflow to reset the profile after 24 hrs which inturn cals the trigger .