I've investigated and found two articles with no answer for this question:

It's been a while, so maybe something could have changed, so raising this question again. I am wondering if there's a way to query Salesforce to get the date of a sandbox refresh. The only thing I've found that comes close is through using this query:

Select createddate from SetupAuditTrail order by createddate asc limit 1

I am wondering if this is still the only viable solution.

  • Are you trying to do so from the sandbox? Because it's quite easy to check in production. – Adrian Larson Apr 24 '19 at 16:34
  • @Adrian Larson Ideally from the sandbox. However, if there's a way to check in production, that would be okay too. Thanks! – David Apr 24 '19 at 16:48

If you log into your production org and navigate to Setup > Deploy > Sandboxes, you can see the Completed On value for each sandbox in the list view. This field tells you when the refresh completed.

You can also click on an individual record and see this field and other details. The full detail would look something like:

             Sandbox Name    Demo Full Sandbox
              Description    Some Description
          Sandbox License    Full
                   Status    Completed
                 Location    CS42
           Current Org Id    00D...
             Completed On    04/23/2019 5:10 PM
               Created By    Automated Process
             Created Date    01/01/2011 11:11 AM
  Last Refresh Request By    Some User
Last Refresh Request Date    04/23/2019 9:35 AM
  • That is doing it manually. I'm trying to not do it manually, as I mentioned I want to use some kind of query. – David Apr 24 '19 at 17:00
  • 4
    You did not make it clear in your post that you want some automated process to pull this data. In fact, you gave very little context. Just because you say you want a query does not mean you are after anything other than actually finding the data point. – Adrian Larson Apr 24 '19 at 17:03

If you are in the sandbox itself, you can try using this query:

SELECT LastModifiedDate FROM Organization

but that's assuming you haven't made any modifications to the Organization record (though i'm not sure what you'd change on it).


From some additional investigation, I've found that using the Tooling API works the best. A simple query to the tooling API gives the information that I need, using the following query:

SELECT SandboxOrganization,ActivatedDate,SandboxName From SandboxProcess

Thanks everyone!

  • 2
    The ActivatedDate field definitely does not give you the right data. That tells you when the sandbox was created. I was going to add info about the SandboxProcess object, but comparing the dates to what shows in the UI, StartDate and EndDate don't line up with Last Refresh Request Date and Completed On, though that would be the logical mapping. – Adrian Larson Apr 24 '19 at 17:12
  • @AdrianLarson Are you accounting for GMT? – sfdcfox Apr 24 '19 at 17:48
  • Yes, the minute values themselves are off. – Adrian Larson Apr 24 '19 at 17:49
  • The original question asked for "date", so if it's just the minute values that are off, it's probably still accurate for the asker's purposes. – Thomas Taylor Apr 24 '19 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.