Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

C# Exception create Cew Contact

$
0
0

Good morning everyone,

I'm running a code that creates a new contact in MSCRM, but when trying to create I get the following message Exception

"A failure protected incorrectly or not protected was received from the other party. See internal FaultException for details of the fault code."

What can it be? Below the code I'm using.

try
{
else
{
conexaocrm string = "Url = http: // intranet: 5555 / Training: Username = admin, password = admin @ 15";
Microsoft.Xrm.Client.CrmConnection connection = Microsoft.Xrm.Client.CrmConnection.Parse (conexaocrm);

using (Microsoft.Xrm.Client.Services.OrganizationService orgService = new Microsoft.Xrm.Client.Services.OrganizationService (connection))
{
Entity contact = new Entity ( "contact");
contact [ "firstname"] = name;
contact [ "lastname"] = name;
contact [ "new_cpf"] = cpf;
contact [ "emailaddress1"] = email;
contact [ "telephone1"] = tel_comercial;
contact [ "birthdate"] = Convert.ToDateTime (dt_nascimento);
Guid = ContactID orgService.Create (contact);

Entity account = new Entity ( "account");
account [ "name"] = "Test Account";
EntityReference EntityReference primarycontactid = new ( "contact" ContactID);
account [ "primarycontactid"] = primarycontactid;
Guid = accountId orgService.Create (account);
}
}
}
catch (Exception ex)
{
Console.WriteLine ( "Error reading CRM Base:" + ex.Message);
}


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>