Pages
Tuesday, March 26, 2013
Mass upload/insert non-English characters to Salesforce
We can mass upload / insert data to Salesforce easily using Data Loader or other API tool. But, if we get the data in Excel file with non-English characters, non-English characters will be come ??, This is happened if we save the CSV file directly from Ms Excel.
To upload in non-English characters correctly, the file should be in UTF-8. Here step by step needs to be done, to avoid Ms Excel limitation in process non-English characters.
[ MS Excel ]
1. Open the *.xlsx file from MS Excel
2. Click File | Save As
3. Give a file name and choose "Unicode Text (*.txt)" for "Save as type :" and click Save
[ MS Notepad ]
4. Open the unicode text file using Microsoft Notepad. Some characters can appear as a box. This is because Notepad cannot display some unicode characters, but you can ignore it at this point.
5. It must be the tab delimitered file. Replace tabs with comma (,)
- Select tab character by dragging the character between two column headers and press Ctrl+C
- Replace all tab characters with comma using Replace function (Ctrl+H)
6. In Notepad, click Save As
7. Give a file name and change Encoding: to "UTF-8"
8. Click Save.
[ Windows File Explorer]
9. Change the file extension from "*.txt" to "*.csv". The file icon should be changed to MS Excel now. If it is not changed, check Windows Folder options. (Windows Start menu > Control Panel > Folder Options > View tab > uncheck "Hide extensions for known file types"). This will show the file extensions. Try changing the file extension again.
[ MS Excel ]
10. Open this CSV file from Excel and verify if the data is okay.
*** If you find any problem in this step, you should NOT save the file from Excel. It will cause the encoding problem!! Just check the data only in Excel. If you see a data problem at this stage, fix the data from the original spreadsheet and repeat the steps again. Or, you can change it from Notepad but should ensure that the file is saved as UTF-8 format.
You can download sample csv file with non-English characters saved in UTF-8 encoding here.
Salesforce Time-Dependent Workflow and Entry Criteria
Time-Dependent Workflow is a very nice feature out-of-the-box from Salesforce. You can easily configure it to do action such as: create task, send email alert, field update and send outbound message. The actions will only trigger when before or after certain date or hour as configured.
Actions for Time-Dependent Workflow is exactly the same with Immediate Workflow, and you can share the same actions between Time-Dependent Workflow with Immediate Workflow, depend on your business needs, even to combine Time-Dependent and Immediate workflow in the same workflow rule.
One thing you need to note when create Time-Dependent Workflow is the Evaluation Criteria, make sure it is set to created or created, and any time it’s edited to subsequently meet criteria only. Created, and every time it’s edited will NOT allow you to have Time-Dependent Actions.
I get a request from my user to change a running Time-Dependent Workflow from 7 days before Birth date to 14 days before Birth date. Here is the step:
Notes:
1. Deactivate workflow rule (step 2 above)
This activity will NOT delete time-dependent actions are placed in the workflow queue.
2. All existing data will NOT trigger again for the Workflow
Because it already met the entry criteria earlier. So, if your Entry Criteria is 'Evaluate the rule when a record is created, and any time it’s edited to subsequently meet criteria', you need to make the record to 'meet' the criteria again:
3. Monitoring
You can monitor record in queue to be triggered for Time-Based Workflow from Setup - Monitor - Time-Based Workflow. You can select some criteria to monitor the queue or just leave all to --None-- and hit Search button.
Limitation and Idea:
The time based workflow queue is not queryable via Apex, or the API or run a report.
Vote for this idea to have ability to export Queue of Time Based Workflow.
Actions for Time-Dependent Workflow is exactly the same with Immediate Workflow, and you can share the same actions between Time-Dependent Workflow with Immediate Workflow, depend on your business needs, even to combine Time-Dependent and Immediate workflow in the same workflow rule.
One thing you need to note when create Time-Dependent Workflow is the Evaluation Criteria, make sure it is set to created or created, and any time it’s edited to subsequently meet criteria only. Created, and every time it’s edited will NOT allow you to have Time-Dependent Actions.
I get a request from my user to change a running Time-Dependent Workflow from 7 days before Birth date to 14 days before Birth date. Here is the step:
- Take a screenshot of existing Time-Dependent Workflow with the actions (for backup purpose)
- Deactivate the workflow
- Delete all Time-Based Workflow queue related to the workflow, from Setup - Monitor - Time-Based Workflow, you can take screenshots as backup purpose.
- Edit Time-Dependent Workflow, once step 3 done, you will see Edit link next to the time trigger. For this sample, let's modify the day to 14 days.
- Activate the workflow rule
Notes:
1. Deactivate workflow rule (step 2 above)
This activity will NOT delete time-dependent actions are placed in the workflow queue.
2. All existing data will NOT trigger again for the Workflow
Because it already met the entry criteria earlier. So, if your Entry Criteria is 'Evaluate the rule when a record is created, and any time it’s edited to subsequently meet criteria', you need to make the record to 'meet' the criteria again:
- Update the record NOT to meet the criteria, then update it back to meet the criteria.
- Example: if we are using Rule Criteria "Birth date NOT EQUAL TO null", we need to make it to null (make sure to backup), then populate the original Birth date back, so it will meet the criteria again.
3. Monitoring
You can monitor record in queue to be triggered for Time-Based Workflow from Setup - Monitor - Time-Based Workflow. You can select some criteria to monitor the queue or just leave all to --None-- and hit Search button.
Limitation and Idea:
The time based workflow queue is not queryable via Apex, or the API or run a report.
Vote for this idea to have ability to export Queue of Time Based Workflow.
Friday, March 22, 2013
How to report Chatter records following by users?
As of the Salesforce Spring '13 release, the maximum number of people and records a user can follow in Chatter is 500. Once a user hits 500, the user is unable to follow any user or record; if you need more than 500 limits, you can log a case to Salesforce support to get this number increased to 2000.
Question, how do you check the number of people + records that have been followed? Easy answer, click on the user profile, and it will show in the right panel of count and items "Following". Then, you can click "Show All (number)" to see all records and people that user are following.
But, is there a way to list all the following items for all users? We cannot find this in the Chatter report. If you are familiar with SOQL or Data Loader, this is possible...
The object that stores all 'following' is EntitySubscription.
EntitySubscription represents a subscription for a user following a record or another user. A user can subscribe to a record or to another user. EntitySubscription is available in API version 18.0 and later.
Here is the simple SOQL:
Select e.Id, e.SubscriberId, e.ParentId From EntitySubscription e order by e.SubscriberId
SubscriberId here is UserId, and ParentId is any object or user following.
If you do not want to auto-follow the records you created (so you do not easily hit max 500), you can configure it from Setup - Personal Setup - My Chatter Settings - My Feeds. Uncheck Automatically follow records that I create.
There are also applications in AppExchange you can install to auto-unfollow Chatter items based on a set of rules; this app was created by Salesforce Lab:
- Cloud Swarm 3 - Chatter Auto Follow - Unmanaged - EE / UE / DE
- Chatter Unfollow Rules - Managed
Reference:
Question, how do you check the number of people + records that have been followed? Easy answer, click on the user profile, and it will show in the right panel of count and items "Following". Then, you can click "Show All (number)" to see all records and people that user are following.
But, is there a way to list all the following items for all users? We cannot find this in the Chatter report. If you are familiar with SOQL or Data Loader, this is possible...
The object that stores all 'following' is EntitySubscription.
EntitySubscription represents a subscription for a user following a record or another user. A user can subscribe to a record or to another user. EntitySubscription is available in API version 18.0 and later.
Here is the simple SOQL:
Select e.Id, e.SubscriberId, e.ParentId From EntitySubscription e order by e.SubscriberId
SubscriberId here is UserId, and ParentId is any object or user following.
If you do not want to auto-follow the records you created (so you do not easily hit max 500), you can configure it from Setup - Personal Setup - My Chatter Settings - My Feeds. Uncheck Automatically follow records that I create.
There are also applications in AppExchange you can install to auto-unfollow Chatter items based on a set of rules; this app was created by Salesforce Lab:
- Cloud Swarm 3 - Chatter Auto Follow - Unmanaged - EE / UE / DE
- Chatter Unfollow Rules - Managed
Reference:
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:
- 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.
- 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
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).
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...?
Subscribe to:
Posts (Atom)







