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, ...
Unanswered

Additional filter on the listpage

(1) ShareShare
ReportReport
Posted on by 54
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:
I have the same question (0)
  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at
    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.)
  • Mohamed Amine Mahmoudi Profile Picture
    26,390 Super User 2025 Season 2 on at
     
    Can you please share with us your code x++ ?
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • CU07041903-0 Profile Picture
    54 on at
    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 
  • Navneeth Nagrajan Profile Picture
    2,407 Super User 2025 Season 2 on at
    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);
     }
     
     
     
     
     
  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at
    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:
     
  • CU07041903-0 Profile Picture
    54 on at
    Public void initializeQuery(Query   _query)
    {
    QueryBuildDatasource  qbds = _query.dataSourcetable(tablenum(PurchReqLine));
    QueryBuildRange       range = qbds.addRange(fieldnum(PurchReqLine,Field1));
    range.value('abc');
    
    next initializeQuery(_query);
    }
     
  • CU07041903-0 Profile Picture
    54 on at
    It is PurchReqCreatePurchListPage.  I also want to understand if initializeQuery is the only place where this change can be done?
  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at
    initializeQuery() is the right method for initializing the query.
     
    For reference, you seem to be talking about PurchReqCreatePurchListInteraction class.
  • CU07041903-0 Profile Picture
    54 on at
    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
    237,801 Most Valuable Professional on at
    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?

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
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans