Filtering from a child Object / Record in Mobile

  • 1
  • Question
  • Updated 3 years ago
  • Answered
Hello All, 

I currently have an accounts page where in the past I have filtered by certain fields (coverage model / account ownership) - the reason behind this was we have multiple account owners - so we created our own account coverage 

We no longer need to filter by fields at the account level. Object B - (lets just use opportunities for example)

When I click on all my accounts - I would like to have a filter where I can only see accounts that have opportunities with my username on the opportunity record. 

I believe I can do this with the sub  query function in the condtion - but I'm not sure how to go about doing this.(where I would create the condition / what object . etc) 

Any help with this would be highly appreciated.

Thanks!
Photo of Marlon Gutierrez

Marlon Gutierrez

  • 252 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
You need to create a condition on the accounts model that does the subquery condition so only accounts with opportunities that are owned by the user name.  Both the primary condition and the subcondition should be filterable default off. 

Then in your mobile page add a button somewhere that activates both of these conditions and requeries the model. 

Then sit back and enjoy your handiwork! 
Photo of Mike Dwyer

Mike Dwyer

  • 3,390 Points 3k badge 2x thumb
How would you set up these filters? I have a set of master records (in a custom object), and some have child detail relationships (to another custom object) and some do not. I want the report, by default, to list only the masters that have details. 

Presumably, the conditions referred to previously would be default ON, but my subquery is filtering out all of the master records.

My model is based on the Parent__c object and contains the fields Name and Id.
The model also includes the child relationship Child__r.
The Child__r "field" includes Parent__c, Name, and Id.
Child__r also includes Active__c, which is used in the child field Conditions as = true.
Child__r also includes Childs_Name__c, which is used in the child field Properties to order by.
The model itself has one Condition, described in the builder as...
  • Parent__c records where Name
  • is in the set of values
  • specified by returning Parent__c values from a subquery on the Child__c object
  • This condition is always on
The Subcondition Logic value on this Condition is blank. [BTW: I have yet to find a definition for this field. What does it do? How is it used?]
The Condition does not have any Sub-Conditions. (Presumably, the "active" condition is defined in the child Conditions. Repeating the same condition in the subquery appears redundant - and was ineffective when I tried it.)

The groups of detail records display nicely "under" their respective master records without the subquery condition. But how do I get rid of the master records that do not have any active children?