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

Query to Weblink table not always working

Using Javascript, we try to do something simple like:
var query = sforce.connection.query("SELECT Id FROM WebLink WHERE Name='###' AND PageOrSobjectType='###'")
but not all users can query the WebLink table. Is it a setting in the profile? Why wouldn't a user have access to this table, especially if they have access to the s-controls table?
I checked the API docs and the WebLink object requires "customize application" permission to create a weblink via the API... this leads me to believe that the "view setup and configuration" permission may be required to query them.  (Just a guess)  It's worth looking into... the users unable to query may need this permission.
I don't think that's enough. The standard Read Only profile has that permission but I still get an error when trying to query the WebLinks table.
hmm... what is the exact error you're getting?  Is it an error being thrown by the API... or a javascript error?
We have tried to do the query both in Javascript and through the API. The following are both errors.
Javascript: uncaught exception: {faultcode:'sf:INVALID_TYPE', faultstring:'INVALID_TYPE: sObject type 'WebLink' is not supported.', detail:{fault:{exceptionCode:'INVALID_TYPE', exceptionMessage:'sObject type 'WebLink' is not supported.', row:'-1', column:'-1', }, }, }
API: INVALID_TYPE: sObject type 'WebLink' is not supported....
Both of the queries work with an admin user but not a read only user. Not sure which other users it works and doesn't work for.

Message Edited by Drawloop on 10-10-2007 08:35 AM