Pages

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 By, Started, 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


Reference: Prepare 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: 



Friday, March 15, 2013

Salesforce Sharing Button

Manual sharing record in Salesforce is easy, user just click Sharing button to share a record to Public Groups, Roles, Roles and Subordinates and Users, only when 'Organization-Wide Defaults' sharing is set to Private or Public Read Only for the object.

By clicking Sharing button, you’ll see who can access that record and why (sharing rule, group, role hierarchy, manual share etc). The Sharing button allows users to extend the sharing of a record. However, Sharing button only displays when appropriate.

Sharing button will be available when your sharing setting is either Private or Public Read Only for an object or related object. For example, Sharing button may appear on Account even though sharing model for Account is Public Read/Write, if your sharing setting for Opportunity is Private or Public Read Only.

Sharing button may not visible for particular user, while other user able to see that button in the same page layout. Some may think, user not able to see the button because do not have permission in the profile assigned, that is not correct.

If user is none of below criteria, user will not see the button, although user able to access the record. Sharing button will be shown if user in following criteria:
  • Administrator
  • Record owner
  • User in a role hierarchy above the record owner, and
  • User that has been granted with “Full Access” sharing
As you see, users with Read/Write permission is not in the list above, therefore they will not see the Sharing button.

But if user is one of above, but do not see the button, check this:
  • Object is child record in master-detail relationship, see sharing setting = Controlled By Parent
  • Sharing button is not added into Page Layout

Lastly, you cannot manually share a contact which not linked to an account.


Reference: Why can’t I see the Sharing button on a record?


Thursday, March 14, 2013

Modify Salesforce report filters value with parameter

It is easy to build report in Salesforce using Report Builder. Any user have 'Create and Customize Reports' permission able to create report. User also able to add filters using Add filters button or just drag field to filter area, included to add filter logic to use AND, OR logic combination. Once save, all the filters will be stay in the report to be used by other users.

But, there is a tip we can use a same report with many different filters value without need to create a new report, as long as the filter field is the same by using parameters in the URL

Here we go:
This is simple report saved with URL
https://cs3.salesforce.com/00OQ0000000PQUB


















By adding pv parameter, we can customize the filters value
https://cs3.salesforce.com/00OQ0000000PQUB?pv0=AP&pv1=Johan













Seems easy....?

Salesforce: How to check Schedule Reports

Salesforce.com report allow users to schedule reports run and deliver to their email or a group of users.







It is very simple and with just a few clicks and user can set it up.














This feature only available for user with Scheduled Reports permission enable in their user profile or user with added Permission Set contain Scheduled Reports permission.

But, there is maximum of reports can be scheduled for each organisation depend on their Salesforce edition use, from Professional, Enterprise and Ultimate. For more information on the limitation, look here.

Because of this limitation, system administrator need to know all reports is scheduled. It is very take time if you would like to check each report if you have hundreds or thousands of report in your company. Salesforce profile a simple way to check scheduled reports if you are system administrator or users with permission View Setup and Configuration.

Here we go:
To see all scheduled reports for your organization, click Your Name | Setup | Monitoring | Scheduled Jobs. Please note that in that section you will see all the scheduled jobs (dashboard refresh, data export, etc). However, you can simply create a list view in order to display only jobs where Type EQUALS "Report Run".

The same way you can monitor schedule jobs for: 
  • Data Export
  • Dashboard Refresh
  • Analytic Snapshot
  • Scheduled Apex
  • Batch Job

You can add in the filter for Next Scheduled Run not equal to <blank> to show only active schedule.

 
Reference: 

Page-level ad