Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Init method in Vend Table

Posted on by Microsoft Employee

Hi ,

I am a beginner in AX, need some help on the below scenario.

I have customized the standard vendor form, i have added a new grid(Table A). My requirement is, when the vendor form is initialized, i need this grid to be populated with values from a different setup table(Table B).

Can anyone suggest how i can achieve this.

Thanks in advance!

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,280 Super User 2024 Season 2 on at
    RE: Init method in Vend Table

    Hi Adithya,

    It is still a bit vague to me. Just having a grid with data from a setup table is not a business requirement, but probably a technical attempt to solve a customers requirement.

    Can you tell the business requirement from a functional point of view?

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Init method in Vend Table

    Hi Adithya,

    How are VendTable and Table B linked?

    You can set a range on tableB init method to show only records where this field has a value "Yes".

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Init method in Vend Table

    You can filter the grid (or actually the data source that you use in the grid) in your code to show only those records.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Init method in Vend Table

    Hi, Table B has a YesNo field. Only records with this field as YES should be populated in the grid.

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Init method in Vend Table

    Why can't you show table B directly in the grid?

    I don't see any reason why you would want to duplicate the data. Of course I'm basing my comment only on the information that you have shared.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Init method in Vend Table

    Hi,

    Thanks for your reply.

    The requirement is, i have a setup table (Table B) in a different form which has some records.

    These records must be populated in the grid(Table A) which is present in VendorTable form.

    So, whenever i click on any Vendor from the All vendors page, this grid should get populated with values from Table B.

  • Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Init method in Vend Table

    Hi Adithya,

    If Table B has a relation with VendTable (or any other data source in the form), you can link Table B to the form data source, set the join source and join type and display the desired row(s).

    Is this what you are looking for?

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Init method in Vend Table

    What do you mean by "vendor form is initialized"? Do you mean that every time the form is opened (=init method is executed), you want to populate your Table A? That would not make much sense in my opinion. You would be just copying data from the setup table every time the form is opened.

    Could you share some background and business requirement? Thanks!

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans