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)

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

I have the same question (0)
  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Hi Emilio Molina!

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

  • Emilio Molina Profile Picture
    105 on at

    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.

  • Verified answer
    Rustem Galiamov Profile Picture
    8,072 on at

    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

    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);

       }

  • Emilio Molina Profile Picture
    105 on at

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

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
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans