private OrganizationDetailCollection RetrieveOrganizations(ConnectionDetail currentDetail) { WebRequest.GetSystemWebProxy(); var service = CrmConnectionHelper.GetDiscoveryService(currentDetail); var request = new RetrieveOrganizationsRequest(); var response = (RetrieveOrganizationsResponse)service.Execute(request); return(response.Details); }
private object RetrieveOrganization(ConnectionDetail currentDetail) { if (currentDetail.OrganizationId == null) { return(null); } WebRequest.GetSystemWebProxy(); var service = CrmConnectionHelper.GetDiscoveryService(currentDetail); var request = new RetrieveOrganizationsRequest(); var response = (RetrieveOrganizationsResponse)service.Execute(request); return(response.Details.Where(d => d.OrganizationId == new Guid(currentDetail.OrganizationId)).FirstOrDefault()); }