Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Workspace Filter based...
Finance forum

Workspace Filter based on a query with an outer join

Posted on by 16
 
Hi, I'm building a workspace and using the SysIFilterEventHandler functionality which works fine when I use inner joins on the base query of the form part.  But the filter logic does not seem to work with fields that reside on tables in the outer join part of my query. 

If, on the other hand, I replace the outer join on the base query with an inner join, then the filter works correctly.  Here is the code in the form part of the workspace
 
public class TestFormPart extends FormRun implements SysIFilterConsumerForm, SysIFilterEventHandler
{


    public void registerDatasourceOnQueryingEvent()
    {
        PurchTableAllVersions_ds.OnQueryExecuting += eventhandler(this.parmFilterFormQueryEventHandler().applyFilter);
    }

    public void onFilterChanged()
    {
        PurchTableAllVersions_ds.executeQuery();
    }



}
any suggests?
 
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 228,251 Most Valuable Professional on at
    Workspace Filter based on a query with an outer join
    What you're saying isn't correct. If you filter an outer-joined table, it does not apply any range to the main table. The query returns all records from the main table and filtered records from the outer-joined table. If you want to filter the main table by your query, use an inner join instead of an outer join.
     
    If you don't believe me, check other sources. For example, let me quote sqlservertutorial.net: The LEFT JOIN returns all rows from the left table and the matching rows from the right table.
  • Martin Dráb Profile Picture
    Martin Dráb 228,251 Most Valuable Professional on at
    Workspace Filter based on a query with an outer join
    What exactly do you mean when saying that it doesn't work?
     
    If you use an outer join, you want to return records from the main table regardless whether there is a corresponding record in the joined table.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,353 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,251 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans