+ Start a Discussion
sreejasreeja 

sandbox refresh interval

i have gone through the different types of sanboxes and their time intervals all  from the documentations .. now my doudt is why we will go for refresh time  the sanbox, can any body explain with the simple example,, i have gone through the document of developer guide.
 I need a  real time example , when and why it is done , with a small scenario.. general example ,,??? 

 
Best Answer chosen by sreeja
Khan AnasKhan Anas (Salesforce Developers) 
It will work fine in a sandbox. There will be no issue in a sandbox. But when you will deploy it, you might get unexpected errors. Refreshing any sandbox is a great way to know that the configuration you are testing with is the same as the configuration in Production. 
Yes, you can create multiple sandboxes for one user. You can set the user in the sandbox. Make sure you put their actual email address but change their username to follow the format of your sandbox username. If you are adding Users, I would suggest adding them to Production.  There is likely already the Permission Sets, Profile, and Role you'll want to add the User to. You can't copy users from the Sandbox to Production.  You can set up a Profile, Sharing Rules, Roles etc and test in a sandbox and then move those, but you can't move the user. Best practice is to just set up users in Production and then create/refresh the sandbox so that they are there as well. 

I hope it helps you.

Kindly mark this as solved if the information was helpful. It will help to keep this community clean.

Thanks and Regards,
Khan Anas

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi,

Greetings to you!

Sandbox Refresh:

While working with sandbox if you already pushed all changes to Production org and want new org for testing new data then you can delete the sandbox and create new will replicate same as production. Whenever you click on Sandbox refresh it will delete existing Sandbox and it’s all data and metadata and create a new Sandbox will replicate same as Production. 

Salesforce sandbox refreshes are all about making your development environments - whether they are Full, Partial Copy or Dev sandboxes - mirror production as closely as possible. When you perform a sandbox refresh, the data in your sandbox is pulled from production to make the sandbox as close to accurate as it’s type allows (i.e. a Partial Copy sandbox will never look exactly like production because it is limited in the number of records it can hold).

Example:

Take for example a tale of two sandboxes. The business has a feature request which requires an Apex trigger update and a new custom field to be added. Sandbox A has been recently refreshed from production. Its metadata is exactly the same as what is in production. Sandbox B has been worked on by multiple developers and has not been refreshed in over a year.

When it comes time to migrate changes from Sandbox A to production, it will go smoothly. The only differences between the two orgs are the changes that you are looking to deploy. So there is no danger of overwriting metadata in production, and no danger of dependency issues creating bugs or other challenges.

The story is not so simple for Sandbox B. Sandbox B doesn’t just differ from production in a few ways, there are in fact hundreds of unused classes, triggers, fields, and Visualforce pages that are on the sandbox that are not present in production. When we test our new feature on our sandbox, it looks good. No issues are seen. But when it comes time to deploy, we’re going to be nervous. How can we be sure that the new feature won’t mysteriously break in production because of a dependency issue?

This challenge is a big part of why so many teams are pushing towards continuous integration for Salesforce. Making small frequent changes and keeping your developer and test environments in sync with production minimizes the risk of bugs and issues. When you deploy massive changes that were tested on an environment that looks nothing like production you can easily run into trouble.

Reference: https://bluecanvas.io/2017/02/27/salesforce-sandbox-refresh.html

I hope it helps you.

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. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
sreejasreeja
hi khan, lets suppose , i had created two  developer  sandboxes, in sandbox one i had created an apex trigger with a logic for the account object ,  and filedvalidations for some fileds in account object and deployed by user1 , , and in another sandbox two  which is not refreshed from a year user had  created same apex trigger and validations with different logics on that same account object and deployed by user2..what is going to happen.
1)can we create mutiple sandboxes for the single user,??.we have 25developer sandboxes..??
 
Khan AnasKhan Anas (Salesforce Developers) 
It will work fine in a sandbox. There will be no issue in a sandbox. But when you will deploy it, you might get unexpected errors. Refreshing any sandbox is a great way to know that the configuration you are testing with is the same as the configuration in Production. 
Yes, you can create multiple sandboxes for one user. You can set the user in the sandbox. Make sure you put their actual email address but change their username to follow the format of your sandbox username. If you are adding Users, I would suggest adding them to Production.  There is likely already the Permission Sets, Profile, and Role you'll want to add the User to. You can't copy users from the Sandbox to Production.  You can set up a Profile, Sharing Rules, Roles etc and test in a sandbox and then move those, but you can't move the user. Best practice is to just set up users in Production and then create/refresh the sandbox so that they are there as well. 

I hope it helps you.

Kindly mark this as solved if the information was helpful. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
This was selected as the best answer
sreejasreeja
Thank you khan anas .... marked as a best answer ...
thanks