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 :
Finance | Project Operations, Human Resources, ...
Answered

Difference between DoUpdate and table.SkipDataMethods()

(0) ShareShare
ReportReport
Posted on by 142

Hi guys,

I have a dubt on DoUpdate vs table.SkipDataMethods(). I mean, I Knew DoUpdate is used when you don't want the code written in the overridden update method to be executed and at the same time want any selected record of that table to be updated. It means if I have a custom code on standard table, my code doesn't get performed.

I didn't get if the same behavior is used by table.SkipDataMethods(). If the answer is NO what is its behavior and when we use it.

thank you for you time!!

Bye

Gildo

I have the same question (0)
  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Difference between DoUpdate and table.SkipDataMethods()

    skipDataMethods is used with set based operations, such as update_recordset. When you call myTable.skipDataMethods(true) before update_recordset, it will ignore the code in update method and do a set based operation. Without skipping data methods it will fall back to record by record operation, and execute the code in update method.

  • Verified answer
    Blue Wang Profile Picture
    on at
    RE: Difference between DoUpdate and table.SkipDataMethods()

    Hi Gildo,

    Using  table.skipdatamethods(true) will skip the code on table update method and that logic will not be executed.

    An other thing that will cause update_recordset to be converted to record per record updates is when the database log is configured for that table.

    http://www.artofcreation.be/2014/08/11/what-you-should-know-about-database-logging-functional-impact/

  • Verified answer
    Pete Alberts Profile Picture
    3,542 on at
    RE: Difference between DoUpdate and table.SkipDataMethods()

    Hi Gildo

    Nikolaos and Blue have already supplied the answer. I'd just like to add on.

    To clarify - you are asking whether the following methods will behave the same:

    //DirPartyTable has update() overridden, so it is a decent example
    class AnotherDayInTheOffice()
    {
        
        static void versionOne(DirPartyTable _party)
        {
            _party.Name = "New name";
            _party.doUpdate();
        }
        
        static void versionTwo(DirPartyTable _party)
        {
            _party.Name = "New name";
            _party.skipDataMethods(true);
            _party.update();
        }
    }

    I'm not 100% sure - they should be. But then the methods have different origins and are used in different scenarios.

    I think your confusion/question will be cleared if you read up about set based SQL operations. A good example will be the class LedgerCovSetBased - lines 55 through 101.

    The Common.skip#####() methods exist to enable developers to write set based SQL operations that actually work. If you write some piece of set based operation code to improve the performance of operation X, your work can be nullified if some user decides to enable DB tracking on your table or maybe some other developer writes an extension on your update/insert/delete method (which was empty). And then the doUpdate/doDelete/doInsert methods probably exist from the beginning of time - you know about them.

    So if you want to skip the code in DirPartyTable.update(), then you should call DirPartyTable.doUpdate(). If you want to update millions of DirPartyTable records and find a way to do it with update_recordset, then you should call DirPartyTable.skipDataMethods().

  • Gildo Calvanese Profile Picture
    142 on at
    RE: Difference between DoUpdate and table.SkipDataMethods()

    Hi Pete,

    thx a lot for you reply.

    I'm going to skip custom code in standard update method on standard table using update_recordset and  skipDatamethods.

    So, I can use skipDatamethods(true). In this way, standard update is performed while custom one isn't and it does a set based operation.

    thank you so much for your time!

    Bye,

    Gildo

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,122

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 918 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 646 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans