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
O2O SimonO2O Simon 

Permission to run a SoQL Query in s-control

I have the following codes in my S-control :

 

var queryResults = sforce.connection.query("Select id, (Select id, ActivityDate,Description,Subject,Status from ActivityHistories where Subject LIKE '%Call%' and Status = 'Completed' order by ActivityDate DESC) from Lead where Id = '{!Lead.Id}' ");

It works perfect for system admin, but for other profile, it returns nothing.

 

Could any one help me pls?

 

 

Thank you very much

 

Simon

shillyershillyer

Is the API Enabled perm on their profile checked?

 

Hope that helps,

Sati

aalbertaalbert

The query is going to execute on behalf of the logged in user's permissions and data visibility. So can the other profiles see the Lead you are querying? Have you tried to use a simple javascript Alert message to display the query string before executing it (to help debug)?