web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Display Method on a DataSource, in a Grid Control

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Verified answer
    Dick Wenning Profile Picture
    8,705 Moderator on at

    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;

    }

  • cujamison Profile Picture
    5 on at

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

  • Momochi Profile Picture
    1,044 on at

    Thanks Dick Wenning !!!

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

    You helped me today also thank you again :)

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 10

#2
Harisgillani Profile Picture

Harisgillani 4

#2
dserp Profile Picture

dserp 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans