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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

C# update record

(0) ShareShare
ReportReport
Posted on by

Hello!

I have an entity named contact and a field named moved(two option yes/no).

I'm already connected to CRM, and I know how to retrieve records.

Can anyone show me how to update moved in contact?

Thank you!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    The following is an example of how to call the Update Request

           private void UpdateContact(Guid contactId)

           {

               Entity contact = new Entity("contact");

               contact.Id = contactId;

               contact.Attributes["new_moved"] = true;

               try

               {

                   service.Update(contact);

               }

               catch (FaultException<OrganizationServiceFault> ex)

               {

                   throw new InvalidPluginExecutionException(ex.Message);

               }

           }

    In the function above, service is the Organization Service that you already have a connection to.

    Hope this helps.

  • Community Member Profile Picture
    on at

    Thank you!!

  • Community Member Profile Picture
    on at

    Hello,

    I got a quick question. Using the code below.

                       Criteria = new FilterExpression(LogicalOperator.And)

                       {

                           Conditions =

                                  {

                                     new ConditionExpression("new_one", ConditionOperator.Null), // statement 1

                                     new ConditionExpression("new_two", ConditionOperator.Null), // statement 2

                                     new ConditionExpression("statuscode", ConditionOperator.NotEqual, 1) // statement 3

                                  }

                       }

    Is it possible to use make statement 2 and 3 into OR condition?

    so like if(statement1== true AND (statement 2 == true OR statement 3 == true))

    Thank you!

  • Community Member Profile Picture
    on at

    Doubtlessly, the substances demand that in case we have decreased our expenses, by then creation will be expediently extended and we can get a https://assignmentmasters.org/accounting-homework.html/ of good position. Regardless, this dream must be fulfilled if the improvement is other than being used fittingly.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans