1

When logging in as a user I can see that they have ListView's that I can't find programatically (I'm a System Administrator). Using the Id of the ListView in the URL when logging in as that user, I looked for the list view in the following ways

QUERIES:

SELECT CreatedBy.Name,CreatedDate,DeveloperName,Id,LastViewedDate,Name FROM ListView

SELECT CreatedBy.Name,CreatedDate,DeveloperName,Id,LastViewedDate,Name FROM ListView USING SCOPE EVERYTHING

(The ListView returned records, but only public list views)

SELECT Id FROM UserListView

SLECT Id FROM UserListView USING SCOPE EVERYTHING

(The UserListView qeuries returned no records)

REST EXPLORER:

/services/data/v45.0/sobjects/ListView/00B1Y000007ErH0 where 00B1Y000007ErH0 is the Id I found while logging in as the user.

(I got a resource not found error)

BULK API:

I exported the entire ListView table via the bulk API but got the same results as the ListView queries above. The UserListView was not available via the bulk API.


I looked through the questions and answers of the following posts and did not find my answer.


Has anyone had any success programatically accessing ListView's that users have created? I need to do some auditing on what kind of views they are creating.

EDIT:

In the metadata documentation for list views I noticed it says

List views with the Visible only to me Restrict Visibility option are not accessible in Metadata API. Each of these list views is associated with a particular user. I wonder if that applies to more than just the metadata api and is completely inaccessible without logging in as each user.

  • 2
    As another user, there is no way to query any ListView record where the person creating it selected "Visible only to me". There is no exception. – Adrian Larson Apr 15 at 17:43
  • Can you add that as an answer so I can choose it as the answer in a few days? – Sam Kamensky Apr 15 at 17:47
2

As another user, there is no way to query any ListView record where the person creating it selected "Visible only to me". As you already found, the Metadata API makes this clear, and there are no exceptions in other APIs either.

  • I ended up logging in to all 50 users and manually moving their list views to public views – Sam Kamensky Apr 16 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.