web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

MS CRM 2013 Online

(0) ShareShare
ReportReport
Posted on by

Hello All

This is Abhijeet from India. I am MS CRM technical Consultant in Nitor Infotech and have some issue related with MS CRM.

Actually I have one .aspx page through which i want to connect with MS CRM 2013 Online. On that .aspx page i have First Name and Last Name. When i click save i need to write some code which will save that contact in MS CRM 2013 Online Contact entity. How will I achieve this using C#. Please suggest your valuable inputs.

I gone through following approaches.

http://crm2011corner.blogspot.in/2012/12/connecting-to-crm-online-with-visual.html

Regards
Abhijeet

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aileen Gusni Profile Picture
    44,524 on at
    RE: MS CRM 2013 Online

    Hi Abhijeet,

    I recommend you to connect to CRM using this new simplified connection:

    msdn.microsoft.com/.../gg695810.aspx

    Then to combine that simplified connection with your app, you can see this link

    msdn.microsoft.com/.../gg695790.aspx

    or

    msdn.microsoft.com/.../gg695803.aspx

    It works for CRM Online and OnPremise

    You can use Early Bound or Late Bound.

    Early Bound you can use Linq ContextAs well, how to use, for example:

    //Create a new contact called Allison Brown.

       var allisonBrown = new Xrm.Contact

       {

           FirstName = "Allison",

    // you may change to FirstName = txtFirstName.Text

    //(your aspnet and so does for LastName

           LastName = "Brown",

           Address1_Line1 = "23 Market St.",

           Address1_City = "Sammamish",

           Address1_StateOrProvince = "MT",

           Address1_PostalCode = "99999",

           Telephone1 = "12345678",

           EMailAddress1 = "allison.brown@example.com"

       };

       xrm.AddObject(allisonBrown);

       xrm.SaveChanges();

    If you use early bound another method:

    Contact newContact = new Contact();

    newContact.FirstName = txtFirstName.Text;

    newContact.LastName = txtLastName.Text;

    service.Create(newContact);

    //you should get the service from var service = new OrganizationService(connection);

    //Early Bound is Case sensitive

    If you use LateBound

    Entity newContact = new Entity ("contact");

    newContact["firstname"] = txtFirstName.Text;

    newContact["lastname"] = txtLastName.Text;

    service.Create(newContact);

    //Late Bound is you need to use lower caps

    You can learn how to generate the Early Bound from this link:

    msdn.microsoft.com/.../gg695803.aspx

    Hope this helps!

    Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans