Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Add a filter field to an in memory source table grid

(0) ShareShare
ReportReport
Posted on by 105

I added a field to the smmActivitites table. I am searching for a way to use that field to filter the grid in the ProjBudgetRevision form which uses the TmpProjBudgetRevisionLine witch it happens to be a InMemory table type.

I have tried adding the field to the TmpProjBudgetRevisionLine table and populate the field using the onInserting event handler of the table, but the event never gets hit. I have also tried the onValidateWrite event which gets hit only when inserting new rows from the grid, but not when the table gets populated when initializing the form, and event when the event gets hit I am no able to update the field from there.

For now I have added the field with a display method, but as I said I need to filter the grid using that field witch I can not do!

Any Ideas?

Thanks in advance for your help.

 

 

*This post is locked for comments

  • Emilio Molina Profile Picture
    105 on at
    RE: Add a filter field to an in memory source table grid

    Thanks for pointing me in the right direction. After reviewing the code I found what was wrong and get it to work!

  • Emilio Molina Profile Picture
    105 on at
    RE: Add a filter field to an in memory source table grid

    This is what I am doing in the post event handler of the ProjBudgetRevisionManager_Post_getRevisionCostLines. I don't see why this would not work. I guess there is something about inmemory tables I don't know.

    Any suggestions or comments will be much appreciated.

    [PostHandlerFor(classStr(ProjBudgetRevisionManager), staticMethodStr(ProjBudgetRevisionManager, getRevisionCostLines))]

       public static void ProjBudgetRevisionManager_Post_getRevisionCostLines(XppPrePostArgs args)

       {

           TmpProjBudgetRevisionLine   tmpRevLine =args.getReturnvalue() as TmpProjBudgetRevisionLine;

           ProjBudgetRevisionLine      projBudgetRevisionLine;

           ProjBudgetRevisionManagerActionType _action=  args.getArg(identifierStr(_action));

           RecId _projBudget=  args.getArg(identifierStr(_projBudget)) ;

           RecId _projBudgetRevision=   args.getArg(identifierStr(_projBudgetRevision)) ;

           update_recordset tmpRevLine

                       setting ISProjWBSEquivalente      = "VALUE"

                       join projBudgetRevisionLine

                       where

                               projBudgetRevisionLine.ProjBudgetLine     == tmpRevLine.ProjBudgetLine &&

                               projBudgetRevisionLine.ProjBudgetRevision == _projBudgetRevision;

           Args.setReturnValue(tmpRevLine);

       }

  • Verified answer
    Rustem Galiamov Profile Picture
    8,072 on at
    RE: Add a filter field to an in memory source table grid

    Hi Emilio Molina!

    I mean what in this class you can find methods which populate data to TmpProjBudgetRevisionLine table and you can extend this class and write some logic.

  • Emilio Molina Profile Picture
    105 on at
    RE: Add a filter field to an in memory source table grid

    Hi Rustem Galiamov. Thanks a lot for your time. I reviewed the getRevisionRevenueLines method on the ProjBudgetRevisionManager class as you suggested. I'd tried extending the post event handler and making an update_recordset of the tmpRevLine, but even it doesn’t throw any error the table does not get updated!

    What is what you have in mind?

    Thanks a lot for your help.

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at
    RE: Add a filter field to an in memory source table grid

    Hi Emilio Molina!

    Take a look at init() method on projBudgetRevLineRevenueTmp DS of the form. Then to the getRevisionRevenueLines() method on ProjBudgetRevisionManager class.

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

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Kempeth Profile Picture

Kempeth 4

#1
Andy Adamak Profile Picture

Andy Adamak 4

#1
Community Member Profile Picture

Community Member 4

Featured topics

Product updates

Dynamics 365 release plans