Fetch Opportunity data based on logged in user using Groovy
Summary: We have below requirement.
We have created a custom object and using context link as a sub tab pointing to Opportunity Object, we need to do following
1) If a Sales person logs in then we need to fetch only his Opportunity records in the custom object.
2) If a Sales Manager logs in then we need to fetch his records + his subordinates records in the custom object.
Groovy for above scenario
Version (include the version you are using, if applicable):
Code Snippet (add any code snippets that support your topic, if applicable):