Sample code to connect Dynamics CE using OAuth and Deactivate the record.
Install the Microsoft.Xrm.Tooling.Connector assembly. public static IOrganizationService GetCrmService1() { var connection = new CrmServiceClient( "Url=https://pane-crm-tafp-dev.crm4.dynamics.com;" + "Username=[username]@[domain].com;" + "Password=password;" + "AuthType=OAuth;" + "AppId=51f81489-12ee-4a9e-aaae-a2591f45987d;" + /// User App Id "RedirectUri=app://58145b91-0c36-4500-8554-080854f2ac97/;" + /// Azure Active Directory Id. "LoginPrompt=Auto" ); var service = connection.OrganizationWebProxyClient ?? (IOrganizationService)connection.OrganizationServiceProxy; return service; } public static void ChangerecordStatusRecord() { IOrganizationService ser