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

How to assign a task or a Lead to a Member or Team Programmaticaly

$
0
0

Hi guys,

Can anyone guide me how I can set a task or lead to a member or a team programmatically?

 var proxyService = ConnectToCRM(CRMuri, CRMusername, CRMpassword);
            try
            {
                //String strLeadTopic = "New Lead at " + System.DateTime.Now.ToString();
                Entity ipsLead = new Entity("lead");
                ipsLead.Attributes["subject"] = crmLeadModel.LeadSubject;
                ipsLead.Attributes["firstname"] = crmLeadModel.FirstName;
                ipsLead.Attributes["lastname"] = crmLeadModel.LastName;
                ipsLead.Attributes["jobtitle"] = crmLeadModel.JobTitle;
                ipsLead.Attributes["telephone1"] = crmLeadModel.BusinessPhone;
                ipsLead.Attributes["mobilephone"] = crmLeadModel.MobilePhone;
                ipsLead.Attributes["emailaddress1"] = crmLeadModel.EmailAddress;
                ipsLead.Attributes["companyname"] = crmLeadModel.CompanyName;
                ipsLead.Attributes["websiteurl"] = crmLeadModel.CompanyWebsite;
                ipsLead.Attributes["address1_country"] = crmLeadModel.CompanyCountry;
                ipsLead.Attributes["description"] = crmLeadModel.Description;
                // User Service Proxy to create the entity object
                proxyService.Create(ipsLead);
                return true;
            }
            catch (Exception ex)
            {
                //throw new Exception("CMR Error occurred - " + ex.Message);
                return false;
            }

Viewing all articles
Browse latest Browse all 46379

Trending Articles



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