How to check Sandbox or Production using Apex?

Sample SOQL:

SELECT Id, IsSandbox, Name FROM Organization LIMIT 1

If IsSandbox is true, the it is Sandbox else it is Production.

Cheers!!!

No comments:

Post a Comment