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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Why Refresh data in GridView ???

(0) ShareShare
ReportReport
Posted on by 578

The gridview is populated from a query, but when is open is updated several times, too when you slide the bar or step on a line, the data is updated. Is there any way to avoid this?

Thank very much!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ajit Profile Picture
    8,788 on at

    And in addition to what Sukrut mentioned, Are you using multiple display methods in that form.

  • Suggested answer
    Israel Gonzalez Profile Picture
    746 on at

    Hi Ismael, I think the problem is the query. Can you show a screenshot about that?

  • ismaelivan Profile Picture
    578 on at

    Son varios métodos (12)

    6837.t2.png

    Are methods with a query simple

    example

    display SalesId obtieneOV(InventSum _InventSum)

    {

    SalesLine sLine;

    select firstOnly SalesId from sLine where sLine.InventRefId == this.inventBatchId;
    return sLine.SalesId;
    }

  • ismaelivan Profile Picture
    578 on at

    This the only large query...

    display TransDate GetDateSum(InventSum   _inventSum)

    {

       TransDate           fecha, fecha1;

       InventTrans         invTrans;

       InventTransOrigin   invOrigin;

       InventDim           invDim;

       str                 sPallet, sItemId;

       ;

       sPallet = _inventSum.wmsPalletId();

       select    minOf(DatePhysical)

       from      invTrans

       join      invDim

       join      invOrigin

       where     _inventSum.ItemId == invTrans.ItemId &&

                 invTrans.InventTransOrigin == invOrigin.RecId &&

                 invDim.inventDimId == invTrans.InventDimId &&

                 (invTrans.StatusReceipt == StatusReceipt::Purchased ||

                 invTrans.StatusReceipt == StatusReceipt::Received ||

                 invTrans.StatusReceipt == StatusReceipt::Registered) &&

                 invDim.wMSPalletId == _inventSum.wmsPalletId() &&

                 (invOrigin.ReferenceCategory == InventTransType::InventTransaction ||

                 invOrigin.ReferenceCategory == InventTransType::Purch ||

                 invOrigin.ReferenceCategory == InventTransType::InventLossProfit ||

                 invOrigin.ReferenceCategory == InventTransType::InventTransfer ||

                 invOrigin.ReferenceCategory == InventTransType::InventCounting||

                 invOrigin.ReferenceCategory == InventTransType::ProdLine ||

                 invOrigin.ReferenceCategory == InventTransType::QuarantineOrder ||

                 invOrigin.ReferenceCategory == InventTransType::Production )

                 ;

       return invTrans.DatePhysical;

    }

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    I couldn't find field inventBatchId on InventSum datasource.Could you please move this method obtieneOV to the datasource InventDim.

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Could you let us know where this display method is residing. If its on the form, please move it to the table InventTrans and cache it on the init method of InventTrans datasource. Also I feel this query can be optimized by reducing the number of joins and introducing fieldlist(like selecting only RecId from tables invDim and invOrigin).

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Your problem is definitely with the display methods. I would like to highlight some of the issues:

    1) You are overusing them. You seem to use a lot of display methods which will hog performance.

    2) You most likely do not use caching of display methods, from which you could gain enormous performance boost. Read all the relevant posts:

    msdn.microsoft.com/.../aa596691.aspx

    http://daxture.blogspot.com/2015/05/cache-display-methods-in-ax-2012.html

    kashperuk.blogspot.hu/.../tutorial-caching-display-methods.html

    3) Based on the above pasted code you are doing inner joins without using the fields for the joined tables after the select statement, so they should be just exists joins since the query criteria does not count (for that you do not have to make it inner joins to fetch the records...).

  • Verified answer
    ismaelivan Profile Picture
    578 on at

    I apply the article daxture.blogspot.mx/.../cache-display-methods-in-ax-2012.html  

    Thank Very much, works more fast!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
imran ul haq Profile Picture

imran ul haq 8

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 4 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans