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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

a

(0) ShareShare
ReportReport
Posted on by 4

a

Categories:
I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Fachuh,

    Are both of these fields in the same table? Or are they string controls on your form not bound to a data source?

  • hfou Profile Picture
    4 on at

    Hi Gunjan,

    they are both on the same data source(table) of the form.

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Fachuh,

    In that case, it will be best to override modifiedField method in the table and assign the value to Field "B" when Field "A" is modified.

    public void modifiedField(FieldId _fieldId)
    {
        super(_fieldId);
    
        switch (_fieldId)
        {
            case fieldNum(Table, FieldA) :
                this.FieldB = this.FieldA;
                break;
        }
    }

    For an example, you can check CustTable\modifiedField method.

  • hfou Profile Picture
    4 on at

    Hi Gunjan,

    thanks, it works for me when I use that code with next modifiedField(_fieldId), instead of super(_fieldId).

    I am just not sure what is the difference, why there can not be used super(_fieldId)? And is it possible to use events for this task? Because I was told to solve this by event.

    Sorry if it is stupid question, I am working in x++ for a few weeks only.

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Fachuh,

    I assumed you were working with a custom table and not a standard one. In case of standard tables, you have to create a CoC on the standard methods  insert, update, modifiedField etc.), since you can't make any changes to standard code. You can learn more about CoC from this link.

    For custom tables, you have the option to override methods. That's where super call is made.

    In case your issue is resolved, please mark the useful answer(s) as Verified. It's done by Did this answer your question? > Yes in the reply.

  • hfou Profile Picture
    4 on at

    Thanks, that's what I needed to know! :)

    marked as Verified, thank.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans