Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Additional filter on the listpage

(1) ShareShare
ReportReport
Posted on by 52
I tried adding Coc for initializeQuery of listpage interaction class to add more filters but there are no expected results. Am I Missing something 
 
Code Details are in the image
Categories:
  • Martin Dráb Profile Picture
    234,615 Most Valuable Professional on at
    Additional filter on the listpage
    First of all, please verify whether you extended PurchReqCreatePurchListInteraction class or you're talking about something else.

    Then tell us what you found when you debugged your code. Does it get called at all? Do you see the expected query string after your code? What query string do you see in GUI then?
  • CU07041903-0 Profile Picture
    52 on at
    Additional filter on the listpage
    The posted code is not having any impact.There is no filtering based of field1 value abc provided.can I know what went wrong in that
  • Martin Dráb Profile Picture
    234,615 Most Valuable Professional on at
    Additional filter on the listpage
    initializeQuery() is the right method for initializing the query.
     
    For reference, you seem to be talking about PurchReqCreatePurchListInteraction class.
  • CU07041903-0 Profile Picture
    52 on at
    Additional filter on the listpage
    It is PurchReqCreatePurchListPage.  I also want to understand if initializeQuery is the only place where this change can be done?
  • CU07041903-0 Profile Picture
    52 on at
    Additional filter on the listpage
    Public void initializeQuery(Query   _query)
    {
    QueryBuildDatasource  qbds = _query.dataSourcetable(tablenum(PurchReqLine));
    QueryBuildRange       range = qbds.addRange(fieldnum(PurchReqLine,Field1));
    range.value('abc');
    
    next initializeQuery(_query);
    }
     
  • Martin Dráb Profile Picture
    234,615 Most Valuable Professional on at
    Additional filter on the listpage
    You could have saved time trying to locate the icon - I already told you that the button didn't have any. I saw it in your screenshot. Here it is:
     
  • Navneeth Nagrajan Profile Picture
    1,954 Super User 2025 Season 1 on at
    Additional filter on the listpage
    Hi CU07041903-0,
     
    A few questions:
    1. Are you looking to apply filters through the PurchReqTableListPageInteraction class?
    2. Are you extending the PurchReqTableListPageInteraction class? 
     
    Let us know the full scenario. It will be easier to answer the question.
     
    A few suggstions based on assumptions:
    If you are looking to extend the PurchReqTableListPageInteraction class then your filter should be like this. Assuming you are extending the PurchReqTableListPageInteraction class.
     
    public void initializeQuery(Query _query)
      {
           var qbds = _query.dataSourceTable(tableNum(PurchReqTable)).addDataSource(tableNum(PurchReqLine));
           qbds.relations(true);
           qbds.joinMode(JoinMode::InnerJoin);
           qbds.addRange(fieldNum(PurchReqLine,field1)).value('abc');
          
          next initializeQuery(_query);
     }
     
     
     
     
     
  • CU07041903-0 Profile Picture
    52 on at
    Additional filter on the listpage
    I didn't find the icon.And I tried pasting the code directly as text but the category field was not showing the drop-down and post was disabled.So after multiple attempts I added a screenshot 
  • Mohamed Amine Mahmoudi Profile Picture
    24,372 Super User 2025 Season 1 on at
    Additional filter on the listpage
     
    Can you please share with us your code x++ ?
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Martin Dráb Profile Picture
    234,615 Most Valuable Professional on at
    Additional filter on the listpage
    Please tell us more about the problem.
     
    Also, why didn't you share the code as text? Did you run into a problem with the forum?
     
    Are you aware of the Insert Code Snippet button? (It's the second one from the right. It has no icon displayed; it looks the same for me.)

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

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 565

#2
Martin Dráb Profile Picture

Martin Dráb 536 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 402 Super User 2025 Season 1

Product updates

Dynamics 365 release plans