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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

form display method repeating grid field

(0) ShareShare
ReportReport
Posted on by 5

I am having an issue with the form initially not showing the notes. On the form there is a notes field in the grid that is pulled from the movement journal posted. When I go into Inventory Management>Inquiries>Transactions>Transactions and scroll to the part/transaction where its suppose to show it does not unless I click on it.  But then it repeats in the other notes above or below when I scroll over it. 

First load of the form/grid:

7455.SS1.png

Once I click 

6318.SS2.png

Code on the datamethod:

 display Description getSMCNotes()
{

    InventTransOrigin  _inventTransOrigin;
    InventJournalTrans _inventJournalTrans;
    str SMCNotes;


            select SMC_InvJournalNotes from _inventJournalTrans 
                   join _inventTransOrigin
                        where _inventTransOrigin.InventTransId == _inventJournalTrans.InventTransId
                        && _inventTransOrigin.RecId == InventTrans.InventTransOrigin;

        return _inventJournalTrans.SMC_InvJournalNotes;
  
   

}

pastedimage1603892964862v5.png

pastedimage1603894245086v1.png

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    The display method must be implemented either in the underlying table, or the form data source that you use in your grid. Is it?

  • kmundt Profile Picture
    5 on at

    Yes, the last screenshot shows it in the datasource.

  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    Can't you just add SMC_InvJournalNotes field from InventJournalTrans to your grid, and not even need any display method? Or do you want to fetch it from some other record than the active selected record?

  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    Ah, sorry, that's not possible. The only form name that I saw in your screenshot was InventJournalTrans. But that's not the form that you are working with.. instead you are working with InventTrans form.

    What if you add this method directly in InventTrans table? Or is there some reason why you want it in the form?

    display Description getSMCNotes()
    {
    
        InventTransOrigin  inventTransOrigin;
        InventJournalTrans inventJournalTrans;
    
    
        select firstonly SMC_InvJournalNotes from inventJournalTrans 
            exists join inventTransOrigin
            where inventTransOrigin.InventTransId == inventJournalTrans.InventTransId
            && inventTransOrigin.RecId == this.InventTransOrigin;
    
        return inventJournalTrans.SMC_InvJournalNotes;
      
       
    
    }

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi kmundt,

    Display method on data source should have buffer parameter. But it's better to create methods on table level (if possible) and use caching (https://docs.microsoft.com/en-us/dynamicsax-2012/developer/caching-display-methods )

    display Description getSMCNotes(InventTrans _inventTrans)
    {
    
        InventTransOrigin  _inventTransOrigin;
        InventJournalTrans _inventJournalTrans;
        str SMCNotes;
    
    
                select SMC_InvJournalNotes from _inventJournalTrans 
                       join _inventTransOrigin
                            where _inventTransOrigin.InventTransId == _inventJournalTrans.InventTransId
                            && _inventTransOrigin.RecId == _inventTrans.InventTransOrigin;
    
            return _inventJournalTrans.SMC_InvJournalNotes;
      
       
    
    }

    By the way you have InventTransOrigin data source already in the form, so you can move your method to InventTransOrigin and simplify select statement.

  • kmundt Profile Picture
    5 on at

    Well I am in the inventTrans datasource. How would it simplify any further?

     display Description getSMCNotes()
    {
    
        InventTransOrigin  _inventTransOrigin;
        InventJournalTrans _inventJournalTrans;
     
                select SMC_InvJournalNotes from _inventJournalTrans
                       join _inventTransOrigin
                            where _inventTransOrigin.InventTransId == _inventJournalTrans.InventTransId
                            && _inventTransOrigin.RecId == InventTrans.InventTransOrigin;
    
               //SMCNotes = _inventJournalTrans.SMC_InvJournalNotes;
            return _inventJournalTrans.SMC_InvJournalNotes;
    
    
    }

  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    Hi kmundt,

    you still don't have the parameter in your method, which is needed as Sergei suggested.

    But even better is to put the method in a table so that you can reuse it. And then you don't need the parameter.

    Using firstonly keyword and exists join will also make your query lighter, improving performance. But moving it to InventTransOrigin data source could allow you to have one less table in the select statement, again making it faster.

  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi kmundt,

    If you implement this method on InventTransOrigin you can just filter data from InventJournalTrans without additional joins

    Form data source version

    display Description getSMCNotes(InventTransOrigin _inventTransOrigin)
    {
        InventJournalTrans _inventJournalTrans;
        ;
    
        select SMC_InvJournalNotes from _inventJournalTrans 
            where _inventJournalTrans.InventTransId == _inventTransOrigin.InventTransId;
    
        return _inventJournalTrans.SMC_InvJournalNotes;
      
       
    
    }

    Table version

    display Description getSMCNotes()
    {
        InventJournalTrans _inventJournalTrans;
        ;
    
        select SMC_InvJournalNotes from _inventJournalTrans 
            where _inventJournalTrans.InventTransId == this.InventTransId;
    
        return _inventJournalTrans.SMC_InvJournalNotes;
      
       
    
    }

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 467 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans