Salesforce Basic

APEX: How to check if ORG is Sandbox or Production

Recently after a major deployment, we took refresh of a sandbox org. One of the developers worked on a change request on the refreshed copy. Unfortunately, he forgot to change Named Credentials, Auth Provider, Remote site setting. After working on the change request, developer started testing the same. This resulted in record creation in third party application through API’s. There were many test records which were created in third party applications and the issue got escalated.

Continue reading “APEX: How to check if ORG is Sandbox or Production”