Hi Team,
I had a requirement to restrict the Organization hierarchy display on the Form i.e. Entire tree structure node needs to be ignored if that node doesn't consists of retail channel.
For example: Please refer the below sample setup done in organization hierarchy (Highlighted nodes doesn't have any retail channels).
Now my requirement was to ignore the display of entire nodes i.e. "East" (i.e. East & IT Department) and "West".
Added new condition ignoring "WEST" node & "IT Department" nodes only because when standard code was traversing through each node added the condition to check whether that node consists any child/not if that was not there this was ignored.
I have duplicated the standard class [RetailInternalOrgTreeDatasource] and added some conditions as this entire customization was Legal Entity Specific.
Class - RetailInternalOrgTreeDatasource
Method - getOrgTreeData
Please refer condition added to the above mentioned method in the attachment file highlighted in UPPERCASE:- (added code in while loop).
Added new condition ignoring entire "WEST" node & "IT Department" nodes only.[View:/cfs-file/__key/communityserver-discussions-components-files/797/6404.getOrgTreeData_5F00_Method.txt]
With new customized Condition in the code:-