Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Add a filter field to an in memory source table grid

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
    Emilio Molina 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
    Emilio Molina 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
    Rustem Galiamov 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
    Emilio Molina 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
    Rustem Galiamov 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

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans