CRM RETRIEVE Entity - Fehler: Objekt des Typs 'Microsoft.xrm.sdk.entity' nicht gegossen, um "CRENTITYS.LIST" eingeben

StackOverflow https://stackoverflow.com/questions/9518994

Frage

Ich erzeugte Entitäten von CRM wie diesem: generasacodicetagpre.

für servicecontextName habe ich xrmservicecontext set. Ich möchte etwas von CRM mit dem nächsten Code von CRM abrufen: generasacodicetagpre.

und ich bekomme Fehler: generasacodicetagpre.

Nach 'zur Anwalt hinzufügen' sah ich, dass jeder Satz von Entitäten im Kontext dieselbe Nachricht hat. Was habe ich vermisst?

War es hilfreich?

Lösung

Problem solved. After initializing OrganizationServiceProxy, I have to call EnableProxyTypes method.

OrganizationServiceProxy orgserv;
ClientCredentials clientCreds = new ClientCredentials();

    clientCreds.Windows.ClientCredential.UserName = username;
    clientCreds.Windows.ClientCredential.Password = password;
    clientCreds.Windows.ClientCredential.Domain = domain;
    IServiceConfiguration<IOrganizationService> orgConfigInfo = ServiceConfigurationFactory.CreateConfiguration<IOrganizationService>(orgServiceUri);

    orgserv = new OrganizationServiceProxy(orgConfigInfo, clientCreds);
    orgserv.EnableProxyTypes();

Key thing is: orgserv.EnableProxyTypes();

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top