Pages

Friday, March 22, 2013

Salesforce Report for SAML Federation Id for SSO


For organization implementing SSO for Salesforce.com login authentication, if you get a ticket from user query that they cannot login to Salesforce via SSO. Here steps for you need to check:
  1. Make sure you are in office network (including VPN) and try to login yourself. If not working, check with your peers of SSO expert, maybe server down or some other issue.
  2. If you can login with SSO, check the user detail and make sure Federation Id is enter correctly.


It is a good practice for admin to run a report to list down all Active users with their Federation Id information. But.... we cannot find Federation Id field in available field using standard Users report type.

So how? You can create custom report type, here we go:

1. Create Custom Report Type
From Setup - Build - Create - Report Types
  • Click New Custom Report Type button
  • Select Users as Primary Object
  • Enter Label, Description and Store in Category (preferred Administrative Reports)
  • Select deployment status
  • Click Next button and Save button
To confirm, click "Edit Layout" button in Fields Available for Reports, you should see "SAML Federation Id" is there.

2. Create Report
Create normal report and select report type created in step 1 from correct report folders.
You should be able to see SAML Federation Id in available field fro report.


Cool..... ?

Thursday, March 21, 2013

How to create report in Salesforce with double quote in filter


A user come to me today asking how to create a report on Account with Account Name contain " (double quote) ?
Hmmm... it seems easily, just type " in report filter criteria using CONTAIN. But, it will not work, since " is consider as string function.

Checking to Salesforce community? @SteveMo response me with excellent answer. Type ' + " + ' (read: without + sign), instead of using " or \" (escape sequence in SOQL).








But I realize, after the report save and open the report again, the value for filter '"' is gone.






Not sure if this Salesforce bug? But, I believe this is something Salesforce need to look into.

Query Chatter comment


In my previous blog, I give overview on Chatter Feed, how to query it, and how it is structured within Salesforce.

In this blog, I would like to give overview on Chatter Comment. Using any API tool, we can query and extract all feed comment into csv file. The API object name is FeedComment (record prefix with 0D7).

Sample query
Select f.Id, f.FeedItemId, f.ParentId, f.CommentType, f.CommentBody, f.RelatedRecordId, f.CreatedDate From FeedComment f

FeedItemId is Chatter feed that comment tag to, and ParentId show the comment is tag to what object, it can go to Opportunity, User, Chatter Group and etc.

As of API version 23.0 and beyond, if you have “View All Data” permission you can query FeedComment records directly without an ID filter. Using API version before 23, you will get this error:






More information on chatter comment here.

Pretty simple...?

Wednesday, March 20, 2013

Query Chatter Feed Item & How the structure in Salesforce object


Salesforce admin can enable Chatter feed tracking on Salesforce objects, including custom objects.
Go to Setup and search for Feed Tracking in the Quick Find search box. Select the object to track and tick "Enable Feed Tracking", you can select up to 20 fields.

In the background, once an object is enabled for feed tracking, Salesforce will create a new object with the suffix Feed (for Standard object) or _Feed (for Custom object). This is available in API version 18.0 and later.

Sample query:
SELECT Id, ParentId, Type, RelatedRecordId, Title, Body, CreatedById, CreatedDate, CommentCount, LikeCount FROM AccountFeed ORDER BY CreatedDate DESC
This query will return all feed tagged to Account (see ParentId field)

Another object storing all feeds is FeedItem, this object is available in API version 21.0 and later, sample query
SELECT Id, ParentId, Type, RelatedRecordId, Title, Body, CommentCount, LikeCount FROM FeedItem ORDER BY ParentId
This query will return all feed tags to any objects.

See the architecture below (right-click the image to enlarge):


Notice that objectFeed object shared the same prefix with FeedItem: 0D5

If you need the screenshot in Visio file, click here


Tuesday, March 19, 2013

Salesforce: Trending with Reporting Snapshot

Can we have a report of data trending in Salesforce? Hmmmm, Salesforce only report current data? But, is there a way to store historical data so we can use it for reporting?

Yes, if you are using Salesforce Enterprise or Unlimited edition, you can configure Reporting Snapshot to store historical data, but do not expect old historical data will be available before configured reporting snapshot. Only historical data for specific reporting snapshot will be available after configured and run properly.

Users with "Manage Reporting Snapshots" permission able to create and configure reporting snapshot. Each edition have a limited number of reporting snapshot can be created, so used it wisely.

Here is the summary to create and configured reporting snapshot:

1. Create a source report, this report type should be only tabular or summary.
Please note, the number of records will be created in target object will be the same with how many records in report result. For a tabular report, it will be one to one, and for a summary report, it will be by group summary or grand summary. If you choose grand summary, it will always create only 1 record in a target object.

2. Create a target object, this would be a custom object in Salesforce. Make sure the target object must not be included in a WORKFLOW.

3. Create fields in the target object, by default reporting snapshot will give us 3 information that we can capture into fields in target object: Reporting Snapshot Name, Reporting Snapshot Running User, Execution Time. Try to create field name similar or represent data will be created from source report.

4. Create the reporting snapshot, from Setup - Data Management - Reporting Snapshots. You need to enter: Reporting Snapshot Name (Job name), Running User, Source Report, Target Object, and Description (optional).

5. Map Fields from Source Report to Target Object, in this step, if your source report type is summary, you need to select grouping level. Applicable source report field will be available for each target object, it is based on the field type.

6. Create Schedule, you can set to email reporting snapshot to yourself, other user or to a group, and select frequency on daily, weekly and monthly basis. Available start time will be shown on this screen.

After the reporting snapshot has been run for a few times, you can build a report to show the trend.


Monitoring
Lastly, you can monitor ALL Reporting Snapshot in your Salesforce instance from Setup - Monitor - Scheduled Jobs. Create a new View and filter with Type = Reporting Snapshots, this will show the Job Name, Submitted ByStarted, and Next Scheduled Run. If the Next Scheduled Run is blank, this means that 'Reporting Snapshot' is no longer active.



In the past Reporting Snapshot is known as Analytics Snapshot.

Blog last updated: 2 Dec 2018


ReferencePrepare Reporting Snapshots


Monday, March 18, 2013

How to list all Dynamic Dashboards in Salesforce?

Dynamic dashboard is great to enable each user to see the data they only have access to or their team have access to, without the need to create separate dashboards using a fixed user "viewing as".


But, each organization only has up to 5 dynamic dashboards for Enterprise Edition and 10 dynamic dashboards for Unlimited Edition, additional dynamic dashboards available for purchase separately.

So, it important for the system admin to know all dashboards configured as a dynamic dashboard. Let us go through how to list down all dashboards configured as a dynamic dashboard.

Here we go:
1. Create a custom report type with the primary object = Dashboards
2. Create a new report using the report type created in Step 1
3. Add filter of "Dashboard Running User" NOT EQUALS TO "Run as specified user" (optional)
4. Run the report. You will see it will only show Dashboard Running User :
  • Let authorized users change running user for dashboard with Let authorized users change running user selected, and
  • Run as logged-in user


Have fun...



Reference



Page-level ad