Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Display Method on a DataSource, in a Grid Control

(0) ShareShare
ReportReport
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!

*This post is locked for comments

  • Momochi Profile Picture
    Momochi 880 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;

    }

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans