You need to sign in to do that
Don't have an account?
Matyas Csaba
Accounts in a given Territory
Hello Helper
I need to retrieve by code all accouts belongong to a given territory (and subordinates but this is secondary)
I know the info is somewhere in AccountShare
My first attempt was to retrieve all users belonging to the territory from UserTerritory object and then run a query against the AccountShare
where UserGroupId in (the user resulted from Userterritory query)
BUT this is not enough. If no User is assigned to the terr I can not find the Accounts
Other option?
I am thinking to query first the Group Object and find those groupID where RelatedId is my Territlry
then go with these UserGroupId back to AccountShare
but this might not be enough again because of the group hierarchy
Did anybody worked on this topic?
Thanks in advance
Csbaa
I need to retrieve by code all accouts belongong to a given territory (and subordinates but this is secondary)
I know the info is somewhere in AccountShare
My first attempt was to retrieve all users belonging to the territory from UserTerritory object and then run a query against the AccountShare
where UserGroupId in (the user resulted from Userterritory query)
BUT this is not enough. If no User is assigned to the terr I can not find the Accounts
Other option?
I am thinking to query first the Group Object and find those groupID where RelatedId is my Territlry
then go with these UserGroupId back to AccountShare
but this might not be enough again because of the group hierarchy
Did anybody worked on this topic?
Thanks in advance
Csbaa
Please check with the below link which might help you to accelerate further on the above requirement.
http://stackoverflow.com/questions/17756357/get-accounts-by-territory-for-specific-user
Hope this helps.
Best Regards,
Nagendra.P