var query = "Select id,Name from User where name ='Integration User' Limit 1"; var records = sforce.connection.query(query); var records1 = records.getArray('records'); acc.OwnerId= records1.Id;
This code fails for a user belonging to some custom profile. It gives error saying "can not specify id of undefined".
But it works fine for System administrator. Clearly problem is about querying User object and access on user records.
What permission should i consider for custom profile user to give him ability to execute this SOQL.