Find your content:

Search form

You are here

User's Dashboard assignment via API or SOQL?

 
Share

Is there a way to access, query, or update the following User preferences via the API or SOQL?

  • The Dashboard assigned to the User's homepage

I've looked for any reference to these in the Force.com IDE's Schema Browser, and also checked the API reference, but can't find any mention of them.

Thanks!

NOTE: I've split this out of another question since the two parts require different answers.


Attribution to: Benj

Possible Suggestion/Solution #1

I took a recent Data Export from a large Org and extracted all the CSV files into a directory.

The key prefix for Dashboards is 01Z, so I searched all the csv files for the string:

"01Z

There were hits in EntitySubscription.csv, FeedPost.csv, and NewsFeed.csv.

The EntitySubscription table (0E8 key prefix) might be where Salesforce stores this information. The CSV has the following columns:

  • Id
  • ParentId - ID of the record or user which the user is following.
  • SubscriberId - ID of the User who is following the record or user.
  • CreatedById, CreatedDate, IsDeleted

The matching rows had the Dashboard id in the ParentId column and User Ids in the subscriber column.

As to how you would access or manipulate this data via the API or SOQL, I don't think you can as I can't see EntitySubscription via the API.

Update

Odd, on the first Org I tried EntitySubscription didn't show via the API. It was available in another one.

Here is a SOQL query to find EntitySubscription records connected to Dashboards:

Select 
     Id,ParentId,SubscriberId,IsDeleted
From EntitySubscription 
Where 
     ParentId in (Select Id from Dashboard)
Limit 100

Attribution to: Daniel Ballinger
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/1009

My Block Status

My Block Content