Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Query::update_recordse...
Finance forum
Suggested answer

Query::update_recordset Bug

Posted on by 17
Hello,
 
I'm trying to use Query::update_recordset, but I think I found a bug
 
Here is a sample job that I created.
 
If you run that in debug mode, you will see that the method InventTable.Update is always called, even if SkipDataMethods, Events and DatabaseLog are passed as TRUE. The execution revert to a 1 by 1 update operation, thus becoming really slow
 
If I use the update_recordset (not the class) the update method is not called and the execution is fast
 
Maybe this is a bug in the class?
 
 
internal final class TestUpdateRecordSet
{
    /// <summary>
    /// Class entry point. The system will call this method when a designated menu 
    /// is selected or when execution starts and this class is set as the startup class.
    /// </summary>
    /// <param name = "_args">The specified arguments.</param>
    public static void main(Args _args)
    {
        Query q = new Query();
        QueryBuildDataSource qbds = q.addDataSource(tableNum(InventTable));
        qbds.addRange(fieldNum(InventTable, ItemId)).value("020061253001");
              
        Map fieldMap = new Map(Types::String, Types::String);
        fieldMap.insert(fieldStr(InventTable, NetWeight), any2Str("105"));
        Query::update_recordset(fieldMap, q, true, true, true);
    }
}
 
  • Suggested answer
    Anton Venter Profile Picture
    Anton Venter 18,504 Super User 2024 Season 2 on at
    Query::update_recordset Bug
    Probably not a bug and is functioning as designed with the idea of if you need a fast solution, you could use the update_recordset statement.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans