Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

Error While Creating opportunity record in CRM 2011 "The specified object was not found."

$
0
0

Error  While Creating opportunity record in CRM 2011 "The specified object was not found."

code is

I have only Added a service reference in VS 2010 project

URL :  http://servername:port/OrganizationName/xrmServices/2011/organization.svc?wsdl

 OrganizationServiceClient orgClient = new OrganizationServiceClient();
            orgClient.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("user name", "password", "servername");
           

            Entity myContact = new Entity();
            myContact.LogicalName = "opportunity";
            createentity2011.ServiceReference1.AttributeCollection myAttColl = new createentity2011.ServiceReference1.AttributeCollection();

              EntityReference t = new EntityReference();
                t.LogicalName = "account";
                t.Id =new Guid(guid);            

myAttColl.Add(new KeyValuePair<string, object>("name", "deal1"));
        
          
            myAttColl.Add(new KeyValuePair<string, object>("customerid", new EntityReference() { Id = t.Id, LogicalName = t.LogicalName }));

 myContact.Attributes = ConvertToCRM2011("opportunity","awx_dealtype","1","picklist",myAttColl);
            myContact.Attributes = ConvertToCRM2011("opportunity","awx_clientrole","1","picklist",myAttColl);
            myContact.Attributes = ConvertToCRM2011("opportunity","awx_leadbrokerrole","1","picklist",myAttColl);

myContact.Attributes = myAttColl;
           
              try
            {
                orgClient.Create(myContact);
            }
            catch (Exception ex){
            MessageBox.Show(ex.Message);
            }

please help its urgent



Viewing all articles
Browse latest Browse all 1000


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