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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

table CustTable update() and additional actions

(0) ShareShare
ReportReport
Posted on by 65

Hi,


While updating some custome field (MyField - a ref AccountNum) in CustTable I need change values in other records same table and same field. It's a correct way - I mean especially declaration variable custTable inside method and using update_recordset?



void update(boolean _updateSmmBusRelTable = true, boolean _updateParty = true)
{
CustTable   this_Orig = this.orig();
CustTable       custTable;
(...)
if (this.MyField != this_Orig.MyField)
{
update_recordSet custTable setting
            MyField = this.MyField
            where custTable.MyField == this.AccountNum
                && custTable.AccountNum != this.AccountNum;
}
}

*This post is locked for comments

I have the same question (0)
  • everand Profile Picture
    65 on at

    Even if I need updating other records (not this one, with is currently updated)?

    BTW

    I created a separate method to achieve my purpose (to use the code in a job also) using doUpdate().

  • Verified answer
    Community Member Profile Picture
    on at

    if you want to update the same table fields during update, you can just assign your new value to respected field before super().

    Ex:

    this.MyField = "MyValue";

    Super();

    This will take care of the update. No need to call the update method twice.

  • everand Profile Picture
    65 on at

    Yes, it works but I wonder if it's in harmony with let's say best practices

  • nmaenpaa Profile Picture
    101,166 Moderator on at

    Did you try it? Did it work?

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

News and Announcements

Season of Giving Solutions is Here!

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 AX (Archived)

#1
TAHER Mehdi Profile Picture

TAHER Mehdi 3

#2
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#2
Nakul Profile Picture

Nakul 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans