function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RainManRainMan 

Custom Filter by a user object (eg. User.Id)

I'm new to salesforce and this is my first post.  Sorry if it is unclear or in the wrong section.  Here we go...
 
I have a custom userlookup field on Account.  The field is called technologysalesrep,   I want to change the "My Accounts" filter to use this new field,  ie. technologysalesrep= User.Id    I'm thinking it should be similar to the accessing fields of an S-Control "{!User.Id}".   Is there anyway I can to do this??
 
Ultimately, I would like to remove the entire Account ownership schema of Salesforce... Our company has multiple sales teams that do not have parallel territories or accounts.   So, in the end, I would like to have an individual ownership field for each team.  I already have the Triggers, objects, and apex classes to automatically handle the assignments.  But, it seems like it is going to be impossible to remove something like OwnerId.   Do you think OwnerId is to embedded into the salesforce logic to try and remove???
 
Or.... What would be totally great... is to be able to completely redefine what "My Account" means for each User.
 
Anyway, I'ld appreciate any help and input.   Thanks in advance!
RainManRainMan

No replies... maybe if I simplify my question a little... Maybe if I asked what I really need??

Is there anyway to change the "My Account" logic in salesforce to be a custom query based on the current user/profile? 



Message Edited by RainMan on 09-29-2008 09:56 AM
TAICETAICE
RainMan,
 
I am not sure this is the best solution, but I think it works.
 
On the object that you are creating the view, in this case Account, define a custom formula field that evaluates if the current User = technologysalesrep.  Then in the View Rules, create a rule that only returns records where that field is True.
 
For example:
1. Create a custom formula field on your Account object : AmITechRep
2. Add a formula function that returns True if Current User is the technology sales rep: IF( technologysalesrep = $User.Id , "True", "False")
3. Define a filter rule in the custom view that filters AmITechRep for "True"
 
That should return only records in which the current user is the TechnologySalesRep.
 
Hopefully this helps.
 
 
susiebsusieb
I tried this formula and it works in filters and reports. Thanks for the suggestio