Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Update of an entity based on a condition

Posted on by 270

Hello,
Is there a way in CRM to do an Update like with we do in sql sesrver : 

UPDATE account
SET attribute1 = value1 
                    WHEN attribute2 > value2 

Thank you in advance.

*This post is locked for comments

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Update of an entity based on a condition

    You can either do it using SSIS and KingswaySoft CRM Connector, or you can create an external application, retrieve the records in an EntityCollection that match that Query Expression, and do an Update on all records.

    You can update multiple records at once by using the ExecuteMultipleRequest message.

  • Suggested answer
    prt33k Profile Picture
    prt33k 6,907 on at
    RE: Update of an entity based on a condition

    CRM doesnt work is SQL way :)

    So the update happens based on GUID unlike SQL where you can apply it based on any condition.

    The UPDATE message will accept the GUID of the record to be updated along with attributes.

    However, you can club all these UPDATE request into a single request using ExecuteMultiple. This however doesnt change the way update happens in CRM - it just reduces the number of calls from client to server.

    msdn.microsoft.com/.../microsoft.xrm.sdk.messages.executemultiplerequest.aspx

    Thanks,

    Prateek

  • Don foufione Profile Picture
    Don foufione 270 on at
    RE: Update of an entity based on a condition

    How can I do it like a bulk in sql?

  • Suggested answer
    prt33k Profile Picture
    prt33k 6,907 on at
    RE: Update of an entity based on a condition

    No, you can do update in bulk like in SQL.

    The update of record need to go through Update message.

    msdn.microsoft.com/.../microsoft.xrm.sdk.iorganizationservice.update.aspx

    Thanks,

    Prateek

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans