Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Can we use Update_Recordset for a single record or just less number of records updating?

Posted on by 87
Hi experts, 
        I am just wondering whether I could use update_recordset to update a value for a single record. Microsoft has used update_recordset where there are lot of records needs to be updated. But is there any downsides we will be having if we use the same for a single record updation? Is there any reason for us to user the update method in this scenario? 
       Also, I wanna understand whether update_Recordset will process anything different when compared to normal update method since it as well hits the table's update method unless the table methods is been forced to not to be called. 
 
Thanks in advance. 
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 229,275 Most Valuable Professional on at
    Can we use Update_Recordset for a single record or just less number of records updating?
    When you run update_recordset, you update all records meeting a condition. There may be multiple records, but it may be just a single one or none at all. Therefore yes, it can be used for a single record.
     
    If update() method is overriden, it'll be called by update_recordset (unless suppressed), as you correctly mentioned. But that means that you're losing performance benefits of update_recorset, because it needs to fetch records from DB and call the method on each of them, instead of simply sending an UPDATE command to database.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,900 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,275 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans