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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Test Display Method

(0) ShareShare
ReportReport
Posted on by 85

Dear All,

I have a display method which returns some value based on a select stmt written in it with some conditions.

This display method is not showing results when used in design level(assigned to a grid column).

So I need to test it, how do I proceed for it? Can I call it in a Job? If so, what is the syntax?

Thank you in advance..!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    5400 Profile Picture
    7,162 on at

    you can write your code in job and print or info the message

    Exm:

    display LedgerAccount deLedgerAccount_FR()

    {

       return LedgerGDPdUDataExport::ledgerAccount_FR(this.LedgerDimension);

    }

    Please find there are two way u can find.

    static void Demo(Args _args)
    {
        LedgerAccount   la,la1;
        Description  dr;
        GeneralJournalAccountEntry  lt;

        Process 1: select the active buffer and call the display method.
        select firstOnly lt where  lt.LedgerDimension == 22565428045;
        la1 = lt.deLedgerAccount_FR();

        Process 2: Copy the code and past in job
        la =  LedgerGDPdUDataExport::ledgerAccount_FR(22565428045);
        info(strFmt("%1 %2",la,la1));
    }

  • Hariharans87 Profile Picture
    3 on at

    Create a job and copy your content & paste in job, pass the return variable to Info function and test.

    One more think, based on the display method return type, the control should be the same type of control. For example:

    If the display method return string value, you are control should be StringEdit

  • Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at

    Display method are still method and you can call them exactly in the same way as methods without "display" keyword.

    Please note that if you use a display method on form, you have to pass the active record as the parameter (see Using the display Method Modifier for details). I mention it because it's a common error.

    Also note having database queries in display methods is a recipe for per performance problems. Ensure yourself that you don't call database more often then necessary. The easiest way usually is putting the method on table and let AX to cache the output (Caching display Methods).

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans