When defining a custom Org Chart Configuration, you have the option to set a Configuration level filter for the Parent Hierarchy Object, the Child Hierarchy Object or both. Unlike the filter functionality that is available to end users from the Action Menu on Org Chart, this filter is applied each time a user navigates to an instance of Org Chart where this Configuration is selected. An end user is unable to clear this filter from the Org Chart UI.
As of the publication of this article, a friendly filter builder interface is not available. A basic understanding of SOQL syntax is helpful when adding a filter. This Trailhead module is a great reference.
Adding Filter Criteria
- From the Org Chart Configuration tab, select the Configuration you want to update with filter criteria or create a new Configuration record
- Under the Object Mapping section find the Filter Criteria field
- Add the desired condition(s)
- This should be formatted as a typical where clause for SOQL but does not need the WHERE included
- Save the Configuration record and navigate to Org Chart to validate results
- Another good way to build and test your filter criteria is by opening the Developer Console and using the Query Editor
NOTE: If using filter criteria and you want to exclude parked records from the chart you will need to include squivr__Parking_Lot_Reason__c = null in your filter. Org Chart excludes parked records by default but when Filter Criteria is defined this condition must be explicitly included. You can simply append to your other conditions (ie, AND squivr__Parking_Lot_Reason__c = null).
Examples
Account Contact Hierarchy with Filter Criteria
Starting with a Configuration where the Default Configuration Option selected is Standard Account Contact Hierarchy, I want to apply filter criteria to only show Contacts that have either Phone or Email populated. I also want parked records to remain in the Parking Lot.
Filter Criteria: Email != null OR Phone != null AND squivr__Parking_Lot_Reason__c = null
Account Contact Hierarchy (Account Contact Relations) with Filter Criteria
Starting with a Configuration where the Default Configuration Option selected is Map Using Account Contact Relations, I want to apply filter criteria to only show Contacts that have Phone and Email populated. In this case, I also want parked records to appear on the Org Chart.
Filter Criteria: Contact.Email != null AND Contact.Phone != null
NOTE: Since this configuration type is setup to use Account Contact Relations, we have to account for this when adding filter criteria. The fields we want to filter on live on the Contact object so we traverse from the Junction Object (Account Contact Relation) using the relationship field, Contact.
Comments
0 comments
Please sign in to leave a comment.