Monday, January 22, 2018

Implementing Custom Permission for Workflow and Process Builder

More than 3 years ago, we wrote a blog on implementing Custom Permission for Validation Rules. In this blog, we are going to share the same Custom Permission, but for automation, including Workflow and Process Builder.

We'll not discuss further on how to create Custom Permission and Permission Set, so please check the blog mentioned earlier if you need a reference to create Custom Permission and Permission Set.

From Workflow Rule Criteria, select formula evaluates to true.
If you have Custom Permission created, you will see $Permission > under Insert Field.

In this sample, I have a Custom Permission name "Edit_Customer_Custom_Permission", select that permission and add it to Rule Criteria $Permission.Edit_Customer_Custom_Permission.

With this criteria, only users assigned to the Permission Set will trigger the workflow, otherwise, the workflow will not be fired.

Process Builder
Let's use the same Custom Permission - Edit_Customer_Custom_Permission. From Criteria - "Define Criteria for this Action Group"
1. Select Formula evaluates to true.
2. In the Build Formula panel, click System Variable.

3. Select Permission >

4. Type or select the Custom Permission, click Choose button.

5. Now you have the formula built $Permission.Edit_Customer_Custom_Permission.

This is the same criteria with Workflow criteria's above.

ReferenceCustom Permission for Validation Rule

Thursday, January 18, 2018

Salesforce: Recycle Bin in Lightning

As of Spring '18 release, Recycle Bin is still not exist Lightning, vote my idea Lightning Experience - Recycle Bin to get this delivered in coming release.

However, if Recycle Bin is a must, and you can't wait if they will be made available in the future release, here is the workaround.

1. Access to page /search/UndeletePage
If your Lightning URL is change this to

Once you access the page, you will see Recycle Bin as in Classic. Note, this is only applicable to users allowed to switch back to Classic. When you finish and click any tab or record, it will bring you back to Lighting.

2. Add to Lightning Component
It would be troublesome to communicate to all users to bookmark that page.
Adding the "Recycle Bin" link to a page will be much easier, including for training and writing manual guide.
With a simple Lightning Page editing, add a Rich Text component, in my case, I add it to the Home page.

Additionally, there is a 3rd app in AppExhange to add Recycle Bin in Lightning

ReferenceLightning Experience - Recycle Bin

Friday, January 12, 2018

Salesforce: Update Records criteria in Process Builder

Until Spring '18 release, in Update Record action, if we have multiple conditions, we can't customize the logic for the condition with AND, OR. Feel free to vote my idea Process Builder - filter logic in Updating Records action.

no option to define logic

While in Define Criteria, the option to customize logic is available since long time back.

If we drill down further, for the condition in Record Update, by default the relation for each condition is AND, however, if we define more than 1 condition using the same field, the relation of the conditions for the same field would be OR, here an example:

From above sample, we define Account Source twice, and Support Level twice, the logic for this can be translated as (1 OR 2) AND (3 OR 4).

Here quote from Salesforce documentation Update Records from a Process.
When you define multiple filters, the filter logic usually defaults to AND. However, if multiple filters have the same field selected and use the equals operator, the filters are combined with OR. For example, your filters check whether a case’s Type equals Problem (1), Type equals Feature Request (2), and Escalated equals true (3). At runtime, those filters are combined to (1 OR 2) AND 3.

ReferenceUpdate Records from a Process

Saturday, January 6, 2018

List file name not in English characters

This blog doesn't really relate to Salesforce, but I come across this issue when need to prepare files name for Salesforce data loader.

This blog only applicable when using Windows machine. If all the files name is in English, there is no issue that you can just use "dir" from the command prompt. But, my issue when the files name is in Korean and Japanese. Manually to copy and paste file name one by one consume too many times if there is a lot of files.

Once I thought that need to install kind of free app for directory printer, but can we just use out of the box thing available from windows? After doing some research, I'm able to achieve this without any extra tool, so I think just to blog it and share with the public.

There is a command called chcp at Windows command prompt. Chcp command displays the number of the active console code page, or changes the console's active console code page. Used without parameters, chcp displays the number of the active console code page.

Depends on your windows language and region setting the result may be different, here is mine, 437 mean United States.

If you type "dir" from the folder with Japanese or Korean or Chinese, they will show as ? for each character.

Because Japanese, Korean, or Chinese support by UTF-8, we can change the console to 65001, by type chcp 65001.

But, if you type "dir" after chcp 65001, you will still see the same ? as earlier in the screen. But, if you copy and paste to Notepad, they will be in their original characters.

Another way is to store the result into a text file dir /b >result.txt 
/b mean only to get the file name without any other data.
>result.txt mean all dir result will store in a new file name called result.txt (you can change to any name preferred.


Thursday, January 4, 2018

SimplySfdc in 2017

We just close 2017 and welcoming 2018. I would like to share some interesting statistics in 2017 for SimplySfdc, a blog dedicated to all Salesforce users and community around the world, and check out here for the statistic in 2016 too. Happy New Year 2018!

In 2017, much less blog is written (less than 55%), but total pageview and session only lower for around 25%.

Page 2017 2016 2015 change*
Total New Page 34 76 80 -55.26%
Total Pageviews 115,744 161,516 148,130 -28.34%
Total Sessions 97,310 130,724 123,964 -25.56%
Pages / Session 1.19 1.24 1.19 -4.03%
*compare 2017 with 2016

Similar with previous years, organic search always contributes the largest portion of traffic source, but direct traffic growth around 11%, this is a good sign that has become more trusted and followed by more people. A small increase in the referral as the traffic source, but the contribution from the social channel is much lower in 2017.

Channel Source 2017 2016 2015
1. Organic Search 69.68% 78.79% 82.98%
2. Direct 23.67% 12.68% 10.58%
3. Referral 3.81% 3.34% 4.33%
4. Social  2.83% 5.19% 2.12%

Google, as we know, is the most common search engine for everyone, the same applies for blog, it contributes more than 96% of traffic in 2017, although it decreases more than 1% compared to 2016. Both Bing and Yahoo stay at the 2nd and 3rd spot, traffic from Bing increase 0.63% compared to 2016, would this mean anything in the search engine war globally?.

Top Search Engine 2017 2016 2015
1. Google 96.23% 97.29% 96.47%
2. Bing 2.53% 1.90% 2.02%
3. Yahoo 0.73% 0.70% 1.40%
4. Other 0.51% 0.11% 0.11%

Top social media contribution to the traffic source for is not much change compared to 2016. LinkedIn raised to #1 with contribution almost 50%, while Twitter contribution almost the same with 2016. Both Stack Exchange and Google+ drop almost 4%, but Facebook gains 3% increase. Reddit appearance as #3 in 2016 is most probably not a real traffic. Total of top five social media contributes more than 97% of total social media as the traffic source.

Top Social Media Source 2017 2016 2015
1. LinkedIn 47.03% 21.77% 20.54%
2. Twitter 27.72% 29.07% 15.40%
3. Stack Exchange  7.65% 11.39% 21.04%
4. Google+ 7.62% 11.43% 8.00%
5. Facebook 7.50% 4.45% 19.36%

There is no change of the top 6 countries of visitors, US visitors contribute around 49% of the total visitor, India contributes a little bit higher for more than 20%, UK visitors decrease over the last 3 years. Russia sudden jumps in 2016 is the fake visitor, now they appeared in #10, which is the same as in 2015. Australia, Canada, and French stays at their position, with the small percentage increase for each of them. Top six countries represent almost 81% of the blog visitors.

Top Visitor Country 2017 2016 2015
1. United States 48.80% 49.04% 45.26%
2. India 20.90% 20.41% 20.96%
3. United Kingdom  4.40% 4.88% 5.96%
4. Australia 2.64% 2.17% 2.91%
5. Canada 2.23% 2.12% 2.74%
6. France 1.97% 1.87% 1.94%

From cities perspective, all 6 cities in 2016 stay the same compare to 2016. Hyderabad, San Francisco, and London visitor drop over last 3 years, while Pune visitors increase for the last 3 years. Top 6 cities represent almost 20% of the total visitors.

Top Visitor City 2017 2016 2015
1. Bengaluru 5.75% 5.74% 5.93%
2. Hyderabad 3.31% 3.51% 3.61%
3. San Francisco  2.99% 3.39% 3.51%
4. New York 2.76% 2.98% 2.56%
5. London 2.38% 2.57% 3.20%
6. Pune 2.10% 2.00% 1.88%

This statistic includes access from desktop and mobile. Total top 5 web browsers contribute more than 99% of the visitors. There are no changes in top 5 web browsers compare to 2016. Chrome becomes more popular web browser among visitors. Firefox still at #2, but with a much lower percentage. Some decrease in the percentage of Safari users. Internet Explorer users still there, but lower over the years. Edge included in Windows 10 gain small increase, but do not move it to the higher spot yet.

Top Visitor Web Browser 2017 2016 2015
1. Chrome 82.98% 78.88% 74.46%
2. Firefox 5.92% 8.37% 12.60%
3. Safari 5.33% 6.80% 5.31%
4. Internet Explorer 4.01% 4.46% 6.59%
5. Edge 1.08% 0.64% 0.16%

In terms of operating system, there is no change in the top 5 web browsers. Windows users increase by 1%, MacOS stay at the same at 17%, a big drop of iOS users, but still at spot #3. Android users gain increase over last 3 years.
Total access from mobile and tablet only 6.77% of the total of visitors. This makes sense because most of the visitors access this blog when they have difficulty in configuring Salesforce using desktop/laptop. iOS users down from 71% in 2016 to 59% in 2017, the rest would be Android users.

Top Visitor Operating System 2017 2016 2015
1. Windows 74.85% 73.78% 77.21%
2. Macintosh 17.11% 17.04% 16.33%
3. iOS 3.84% 5.26% 3.37%
4. Android 2.63% 2.18% 1.60%
5. Linux 1.08% 1.23% 1.24%

This year, we see 1920x1080 resolution take over 1366x768 as top screen resolutions, 1920x1080 found in high-end laptop and bigger screen LCD monitor. The rest of screen resolution are all slow down, with exception of 1280x720 now raise to spot #5, it used to be #10 in 2015 and #9 in 2016, this resolution mostly found at the middle-end tablet or mobile phone. 1280x1024 which is at #5 in 2016 and 2015, now drop to #9, which is fount at older LCD monitor.

Top Visitor Screen Resolution 2017 2016 2015
1. 1920x1080 29.06% 22.46% 20.58%
2. 1366x768 22.58% 26.81% 27.01%
3. 1440x900 8.24% 8.94% 9.65%
4. 1600x900 6.11% 8.22% 9.53%
5. 1280x720 4.88% 2.21% 1.20%

Top 5 Popular Page
For popular pages, 3 of 5 top pages from 2016 still stay in 2017. There is one post created in late 2015 How to log a Case to Salesforce support (#3~2016) is no longer popular, as Salesforce change easier way for the user to log a support case. Another blog Salesforce: Custom Button to pre-populate Fields (#5~2016; #3~2015; #2~2014) also no longer popular, as user start switching to Lightning.
A new blog post in early 2017 gain popularity to #2, while Data Loader post from Sep 2013, now gain popularity and take spot #5.

1. Salesforce: How to export Attachments? (#4~2016; #4~2015; #5~2014)
3. Salesforce: ISBLANK() or ISNULL() (#1~2016; #2~2015; #3~2014)
5. Salesforce: Data Loader Time Zone (#8~2016; #13~2015) 

Top 5 Landing Page
1. Salesforce: How to export Attachments?

Top 5 Referral Site
2. Salesforce Ben ~ Ultimate Salesforce Blogs List
3. Salesforce Ben ~ November Round Up of the Top Blog Posts!
4. Salesforce Stack Exchange ~ Why is Transfer Record a system permission?
5. Salesforce Stack Exchange ~ Chatter feed data migration!

Sub Blog
I also have 3 sub-blog, where the traffic is not part of the statistic listed above:


Page-level ad