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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Populating fields

(0) ShareShare
ReportReport
Posted on by 5

Hi,

I am Microsoft dynamics ax intern and I am new to this.

I have a form for inserting new offer. This form has a checkbox vendor field.

The request is: when vendor checkbox is selected, the enum field (Accommodation) must be automatically filled with information about accommodation that selected Vendor offers.

I suppose I can override the modifiedField method on a table level, but I need an example how the code should look and how do I implement this.

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    you can take a look at CustTable table modifiedfield method, and there is case statement written Payment Schedule gets update based on the selection of Paym term id,

    hope this helps

  • Martin Dráb Profile Picture
    239,392 Most Valuable Professional on at

    We can't say how it should be implemented, because we don't have enough information about your form.

    For example:

    1. Is Accommodation bound to a table field? If so, which one?
    2. How do know which vendor is selected?
    3. How do you find accommodation selected by a vendor?
    4. Shouldn't you update Accommodition also if a different Vendor offer gets selected (if possible)?

    By the way, the category of your question should be Development / Customization / SDK, not Other.

  • Verified answer
    abhishek.srivastava.129 Profile Picture
    139 on at

    As Martin rightly pointed out, we don't have enough information about your question. But just to give you a quick example,

    Assumptions

    You have the following fields on a table (which we will call Table A),

    • IsVendor - Checkbox to mark if it is a vendor
    • VendId - Vendor Account to store the vendor account number
    • Accommodation - Enum field to store Accommodation

    This is how your code would look like on the overridden modifiedField table/form method, 

    public void modifiedField(FieldId _fieldId)
    {
    
       super(_fieldId);
    
       switch(_fieldId)
       {
            case fieldNum(TableA, IsVendor):
                this.Accommodation = this.IsVendor ? VendTableExtension::find(this.VendId).Accommodation: this.Accommodation;
            break;
       }
    
    }

    There is a good chance that this might not be helpful for you at all. If you want a specific answer, please provide us with more details. You can start with how the data is stored in your table.

  • Ste08 Profile Picture
    5 on at

    Thank you.

    This helped a lot.

  • Ste08 Profile Picture
    5 on at

    I did not see a development category, that is why I clicked Other.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 689

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 606 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 356

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans