예제 #1
0
        public void PassOrganizationProxyData()
        {
            OrganizationServiceProxy service = CRMHelper.getOrganizationProxy();

            ServiceReference1.ProxyServiceClient Obj = new ServiceReference1.ProxyServiceClient();

            System.ServiceModel.Description.ClientCredentials cred = service.ClientCredentials;


            string url = service.ServiceManagement.CurrentServiceEndpoint.ListenUri.ToString();


            Obj.getConnectedandReturnAccountName(cred.UserName.UserName, cred.UserName.Password, url);
        }
예제 #2
0
        public void CreateAccountWithUserImporsonate()
        {
            ServiceReference1.ProxyServiceClient ProxyCRMServiceObj = new ServiceReference1.ProxyServiceClient();

            DateTime             startTime = DateTime.Now;
            IOrganizationService service   = CRMHelper.ConnectToMSCRM();
            DateTime             EndTime   = DateTime.Now;

            var DiffinSecond = (EndTime - startTime).TotalSeconds;

            Console.WriteLine("Total Time Taken in Connect in seconds :" + DiffinSecond);
            Guid UserId = getCurrentUserId(service);

            UserId = new Guid("3DE87036-0DA1-E511-80ED-3863BB3C2660");

            Guid accountId = ProxyCRMServiceObj.CreateAccountwithImporonatedUser(UserId.ToString());
        }