web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Momochi Profile Picture
    1,013 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
    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
    8,705 Moderator 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#2
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans