domingo, 15 de septiembre de 2013

CRM 4.0 - Funcion GetCrmService

private CrmSdk.CrmService GetCrmService(string organizationName) {
            // Setup the Authentication Token
            CrmSdk.CrmAuthenticationToken token = new CrmAuthenticationToken();
            token.OrganizationName = organizationName;
            CrmSdk.CrmService crmService = new CrmSdk.CrmService();
            crmService.Credentials = System.Net.CredentialCache.DefaultCredentials;
            crmService.CrmAuthenticationTokenValue = token;
            return crmService;
        }

...

CrmService crmService = GetCrmService("organiacion");
crmService.Credentials = new System.Net.NetworkCredential("usuario", "pass", "domain");

No hay comentarios:

Publicar un comentario