Retrieving Members of Team – CRM


Hi,

We can make use of the following function for retrieving the members of a particular team

It takes as parameter instance of a ICrmService(CRM 4.0) or CrmService (CRM 3.0) and the guid of the team and returns an arraylist of of all the members found in the team

public ArrayList GetMembersOfTeam(ICrmService service, String TeamID)
{
// We want the guid of the system users in the team
ColumnSet cols = new ColumnSet(new String[] { “systemuserid” });
// We need to make use of RetrieveMembersTeamRequest class for that
RetrieveMembersTeamRequest rmtRequest = new RetrieveMembersTeamRequest();
// Converting the string TeamID to guid
Guid headGuid = new Guid(TeamID);

rmtRequest.EntityId = headGuid;
rmtRequest.MemberColumnSet = cols;

RetrieveMembersTeamResponse retrieved = (RetrieveMembersTeamResponse)service.Execute(rmtRequest);

// using generic businessEntity list
List<BusinessEntity> sysResult = retrieved.BusinessEntityCollection.BusinessEntities;

// for CRM 3.0
// BusinessEntity[] sysResult = retrieved.BusinessEntityCollection.BusinessEntities;

ArrayList userGuid = new ArrayList();

foreach (BusinessEntity be in sysResult)
{
systemuser user = (systemuser)be;
userGuid.Add(user.systemuserid.Value.ToString());
}
return userGuid;
}

Bye

System.Net.WebException the request failed with HTTP status 401: Unauthorized.” Source=”System.Web.Services”


Hi,

I was gettng this error when trying to call the crm’s webservice from my asp.net page

The resolution for this is putting the following code in the web.conig

i.e. enable impersonation and deny anonymous access

<authentication mode=”Windows” />
<identity impersonate=”true”/>
<authorization>
<!–Deny all unauthenticated users–>
<deny users=”?”/>
</authorization
>

Bye

CRM 4.0 – Exception: Unhandled Exception: System.Net.WebException: The request failed with HTTP status 401: Unauthorized.


Hi,

I was facing this error when i was writing a plugin that was using CrmService.

After searching on internet i found out this

The problem was because Friendly name and Organization name were different.

The solution for it was

1. Launch Deployment Manager on the Web server
2. Select the Organization, Right Click -> Disable
3. RightClick Again and Click Edit Organization
4. Change the Organization Name and FriendlyName to be the same
5. Click Next and Finish.

solution

Bye

Invalid action error-Microsoft Dynamics CRM 4.0


I was getting the Invalid Action error when trying to open Microsoft CRM 4.0.

And in the event log i could see the following entry.

Event Type:    Error
Event Source:    MSCRMKeyGenerator
Event Category:    None
Event ID:    18949
Date:        6/11/2008
Time:        4:59:35 PM
User:        N/A
Computer:    D-4526
Description:
Current active key (KeyType : CrmWRPCTokenKey) is expired.  This can indicate that a key is not being regenerated properly.  Current Active Key : CrmKey(Id:6e254808-b21d-dd11-9041-001d7d22e1af, ScaleGroupId:00000000-0000-0000-0000-000000000000, KeyType:CrmWRPCTokenKey, Expired:True, ValidOn:05/09/2008 10:23:58, ExpiresOn:06/11/2008 10:23:58, CreatedOn:05/09/2008 10:23:58, CreatedBy:NT AUTHORITY\NETWORK SERVICE.  Key Setting :

Starting the Microsoft CRM Asynchronous Processing Service on the server solved the problem for me!!!

There was an error downloading ‘http://localhost/…./Service.asmx’. The request failed with HTTP status 503: Service Unavailable.


I was receiving this error when I was trying to add web reference to the webservice which was deployed in our server from inside our Visual Studio.

 

But putting the same url in the IE, everything seemed to work fine. So there was no issue of IIS not running.

 

Later I realized that the issue was because of the a software that I was using Ultrasurf (UltraSurf is the flagship software product from UltraReach Internet Corp. for Internet anti-censorship. It enables users inside countries with heavy Internet censorship to visit any public web sites in the world safely and freely.)

 

But even after closing the UltraSurf the problem persisted. I restarted the system, cleared my system using CCleaner but wasn’t able to solve the problem.

 

Finally this is something I tried and it worked for me

 

I went to Tools Internet Options Connections (tab) LAN Settings for IE

 

In the LAN settings dialog box, checkbox Bypass Proxy Server for local addresses was checked so I unchecked it than clicked OK two times to close both the dialog boxes.

 

Then again went to Tools Internet OptionsConnections (tab) LAN Settings

And in the LAN setting dialog box again checked it.

 

This way I was able to resolve the issue of not being able to add web reference to web services from inside Visual Studio.

 

 

 

 

 

 

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Crm.Sdk….’


I created a simple plugin and when I was trying to register the plugin through the plugin registration tool I was getting the follwing error

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Crm.Sdk, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

at System.Reflection.Assembly._GetExportedTypes()

at System.Reflection.Assembly.GetExportedTypes()

at PluginRegistrationTool.AssemblyReader.RetrievePluginsFromAssembly(String path) in C:\Documents and Settings\arvinds1\Desktop\PluginRegistration\AssemblyReader.cs:line 59

at PluginRegistrationTool.AssemblyReader.RetrievePluginsFromAssembly(String path)

at PluginRegistrationTool.RegistrationHelper.RetrievePluginsFromAssembly(String pathToAssembly) in C:\Documents and Settings\arvinds1\Desktop\PluginRegistration\RegistrationHelper.cs:line 49

at PluginRegistrationTool.PluginRegistrationForm.btnLoadAssembly_Click(Object sender, EventArgs e) in C:\Documents and Settings\arvinds1\Desktop\PluginRegistration\PluginRegistrationForm.cs:line 127

 

The way I resolved the issue was by adding the microsoft.crm.sdk.dll to my machine’s GAC !!

I hope it works for others as well !!!