I have a table that is optionally related to a parent Opportunity table, meaning that the lookup field is not always populated. The problem I was trying to solve was that I needed a view to show all rows where the Opportunity lookup is blank, or the Opportunity status was "Open". This would be easy with SQL using an outer join, but you cant do it directly in a model driven app with a view that users can maintain because the view filter for a related table only lets you join where the opportunity lookup is populated.
I came up with this solution, where I added a PowerFx expression field to the child table that contains this formula:
If('Opportunity'.Status= 'Status (Opportunities)'.Open,"Open",If('Opportunity'.Status= 'Status (Opportunities)'.Won,"Won",If('Opportunity'.Status= 'Status (Opportunities)'.Lost,"Lost",If(IsBlank('Opportunity'),"No Opp",""))))
Now I can make a view that filters on any row where the field says "No Opp" or "Open" and no need for a join to the Opportunity table.
No comments:
Post a Comment