Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

modified field value method

Posted on by 325

hi i am new to AX i want to do some task ill share my requirement any one pls help me how to do.

i have to tables emp parent and emp child.emp parent consist 2 feilds thats is id and name.

emp child consist id,name and location.

emp parent:

id  name

1     A

2      B

emp cheild:

id   name location

these are the feilds and data in tables.now in emp child ill put dropdown for id that id i can get from emp parent using normal relation.suppose in drop down(emp cheild table feild is id) if i select 1 the name A has to automatically for that which method i have to write any suggestions pls......tnk u 

*This post is locked for comments

  • Suggested answer
    UmesH@ Profile Picture
    UmesH@ 810 on at
    RE: modified field value method

    Right Click on table Method and Create New Method.

       Display str MethodName()

       {

           ParentTable objParentTable;

           ;

           select Name from objParentTable where objParentTable.id == this.id;

           return objParentTable.Name;

       }

  • karthik143 Profile Picture
    karthik143 325 on at
    RE: modified field value method

    for that which method we have to use can u pls show me example code for getting name and delivery.......

  • Suggested answer
    Divya Lakshmi Profile Picture
    Divya Lakshmi 745 on at
    RE: modified field value method

    Hi,

     You can take up an below best example in-order to solve your requirement.

     For eg:

        In SalesOrder form when you create new sales order.

        Sub form(Form name : SalesCreateOrder, Form display name: Create Sales order)  will be opened to enter customer account details etc.

       In that particular form when you select customer account ,Customer name and delivery name will be filled. Here Customer is a display method whereas delivery name is a field.

     Hope this helps!

  • Sohaib Cheema Profile Picture
    Sohaib Cheema 46,610 User Group Leader on at
    RE: modified field value method

    you are trying to go into an  architecture, which is resulting in unnecessary data.

    One simple way can be as following.

    Create a relationship on your Child Table. Using RecId  of ParentTable

    ChildTable.RefRecId == ParenetTable.RecId

    RefRecId is a new added field of 64-bit INT, and remove both field (id, name) from child table.

    Now use reference group to display any information from Parent Table to Child Form.

    Note display methods have issues such as You cannot filter by Grid, These can make your form load slow, in some situations

  • karthik143 Profile Picture
    karthik143 325 on at
    RE: modified field value method

    thank you ill try with your logic

  • Verified answer
    UmesH@ Profile Picture
    UmesH@ 810 on at
    RE: modified field value method

    Table Parent

    id Name

    1   A

    2   B

    Table Chield

    id Name Location

    ----------------------------

    First Create Relation in Child Table Like

    1> Create EDT and Set reference table property (your Parent table name).

    2>go to table expand it Click on Relation Create New Relation in Table Property fill you Parent Table Name. after Right click on Create Relation and Create new Normal Relation and Set Property Field your Child Table Field(id) and related filed your Parent table field(id).

    3> Child table field set in relation EDT which One you Created before.

    and you will get DropDown in Grid in Child table.

    ---------------------------------------------------

    If you want when you select id 1 then automatically name will fill in child table then you have to create method in Child table

    1> go to Child table method create new display method and set your logic there.

    like

    Display str MethodName()
    {
        ParentTable objParentTable;
        ;
        select Name from objParentTable where objParentTable.id == this.id;
        return objParentTable.Name;
    }

    2> now Copy method name and in form grid name field (Child table name string control) property set method name.

    Now run and you will get Popup and Name also.

    Thank you.

    if Suggested ans Reply.

  • karthik143 Profile Picture
    karthik143 325 on at
    RE: modified field value method

    in cheild table i have three feilds (ID,NAME,LOCATION).ID feild have drop down in that drop down data is 1,2.if i select 1 in ID feild i have to get data automatically in NAME feild that is A. that  data  already in parent tabe.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,280 Super User 2024 Season 2 on at
    RE: modified field value method

    Hi Karthik,

    Can you rephrase your last part of the question? It is not readable.

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans