Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Display method

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Scenario:

I have 3 fields in table 1: ID, name, phone Num

In table 2 i have Id and Name.

I have created relation between tables

Requirement: When i select id in table 2 i should get name of that person in name field.

How to achieve this ??

can we achieve this using display method?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Display method

    Thank you Suthar...I have achieved the result by this method....When i use modify method the fetching is delayed...

  • Verified answer
    Viral Suthar Profile Picture
    Viral Suthar 279 on at
    RE: Display method

    Hi, If ID is a primary key field in both tables, then why you need to store name again, just show it using display method from table 1 (master table) like custTable and salesTable, you just have to select customer account and it will automatically display the name from masters...

  • 5400 Profile Picture
    5400 7,160 on at
    RE: Display method

    What is your scenario:

    1. If you want to fetch the  data from table 1 with respect table 2 ID , Assume ID is the relation between two table.

    if you want to display in in same buffer

    you can write modify method to display

    select firstonly table1 wher t1.id = t2.id

    t2.name = t1.name

    of if you don't have bound control you can write display method in tabel and display in UI and do the cache

    same way

    purblic display EDt meth()

    {

      select firstonly table1 wher t1.id = t2.id

      return table1 .name  whatever.

    }

    Please need more info for deatils.

  • Suggested answer
    Sohaib Cheema Profile Picture
    Sohaib Cheema 46,610 User Group Leader on at
    RE: Display method

    use modifiedField() method on Table2 and write a switch case with example as under

    public void modifiedField(FieldId _fieldId)

    {

    super(_fieldId);

       switch (_fieldId)

       {

           case fieldNum(Table2Name, Id):

            Table2Name.NameField = "any value";

           break;

       }

    }

  • Suggested answer
    Anton Venter Profile Picture
    Anton Venter 18,788 Super User 2024 Season 2 on at
    RE: Display method

    Hi, you can achieve this with an edit method, also see Axaptapedia. Also, there are many examples of this in the application.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans