Get Salesforce organization id using apex

Id OrgId = UserInfo.getOrganizationId();

Leave a Reply