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
GambitGambit 

S-Controls??

Hey ,
Does anyone know if S-controls can be used to change(or rather restrict) the contents of a lookup field.
I have a lookup field which shows me all the data. I would like to restrict the view to different users. For eg, the system administrator will get to see all the records, but the sales rep should not be able to see everything, just the records that are relevant to his area.
Is it possible to do this using s-controls??
Awaiting your response.
JohanLiljegrenJohanLiljegren
In your S-Control, what method are you using to get the data you're showing?

If you run a SOQL statement from within the S-Control, I was under the impression that it will run with the logged on user's credentials, i.e. only returning the records you're allowed to see.
If, however, you're calling an Apex method that does the SOQL:ing and returns the data, I believe that will run as "the system", i.e. return all records matching your criteria, regardless if you in fact should have access to see them.

Feel free to prove me wrong, though. =)
JohanLiljegrenJohanLiljegren
*doh* :smileysurprised:

After reading your post once again, I realized my answer wasn't really an answer to what you asked.
What I believe you're looking for is basically a filtered lookup, based on profile or similar. For that, I have no clue. :(

Sorry for the mix-up.