Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Display Method on a DataSource, in a Grid Control

Posted on by Microsoft Employee

Hi,

we tried to use a display method on a datasource ( because we have a temporary table and we don't save the data until we close the form) in this scenario:

in a grid control, on a Id field, we open a lookup form, select a record from the other table, and then , in a string edit control bound to the datasource and having the datamethod property bound to the displaymethod created on the datasource, I want to display something similar to the name of a customer.

The problem is that when we add records in the grid, with CTRL-N, after selecting a new value for the Ident field, the displayed value is changed on every row.

If I move on another row in the grid, the corresponding value is displayed on all the rows.

Here is the code for my display method:

display str dispDebitor()
{
    simtDebitor deb;
    ;
 
    select nume, prenume from deb where deb.Ident == simtcotetmp.IdDebitor; 

    return deb.Nume;

}

Thanks a lot!

  • Momochi Profile Picture
    Momochi 855 on at
    RE: Display Method on a DataSource, in a Grid Control

    Thanks Dick Wenning !!!

    I was wondering of what is the use for these parameters haha.

    You helped me today also thank you again :)

  • cujamison Profile Picture
    cujamison 5 on at
    RE: Display Method on a DataSource, in a Grid Control

    Thank you Dick.  This helped me today on a related issue.

  • Verified answer
    Dick Wenning Profile Picture
    Dick Wenning 8,705 on at
    Re: Display Method on a DataSource, in a Grid Control

    when a display method is places on a datasource, you muste add the table in the parameter.

    in youre case it would be something like this:

    display str dispDebitor(simtcotetmp _simtcotetmp)
    {
        simtDebitor deb;
        ;
     
        select nume, prenume from deb where deb.Ident == _simtcotetmp.IdDebitor; 

        return deb.Nume;

    }

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,349 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,212 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans