Failure in Conexion CRM On Line

0
24
Forum Post: Change the Filter On option on Opportunity Associated View for Account form


Good afternoon,

I’m creating a class that connects to CRM On Line version v.9.2, but I’m getting the error “Unable to Login to Dynamics CRMOrganizationServiceProxy is null”, can someone help me, below is the code I’m using

D365ConsoleCRUD namespace
{
class Program
{
static void Main(string[] args)
{
OAuthConnexion connection = new OAuthConnexion();
CrmServiceClient svc = connection.ConnectionOAuth();

if(svc.IsReady)
{
Console.WriteLine(“With Connection”);
}
else
{
Console.WriteLine(“No Connection”);
}

}
}
}

public class OAuthConnection
{
public CrmServiceClient ConnectionOAuth()
{

string url = ““>xxxxxx.crm2.dynamics.com”;
string userName = “[email protected]”;
string passWord = “xxxxx”;

string con = [email protected]
Url = {url};
AuthType = Office365;
userName = {userName};
passWord = {passWord};
RequiredNewInstance = True”;

CrmServiceClient svc = new CrmServiceClient(con);
return svc;
}

}



Source link

Leave a reply

Please enter your comment!
Please enter your name here