Pages

Tuesday, December 19, 2017

Salesforce: How to block Workbench?

Workbench is an unofficial, yet powerful tool for Salesforce admin and developer to perform almost anything related to Salesforce support. In many cases, end user supposed have no access to this tool, although it still honors user permissions assigned in Salesforce. However, can we block the normal users from accessing Workbench?

Yes, in the previous blog, we discussed how to turn off Salesforce1. Using the same method, we can block the normal user from accessing Salesforce from Workbench.

1. Connected Apps
Navigate to Setup | Apps | Connected Apps | Manage Connected Apps, click Edit link on Workbench.
Change the 'Permitted Users' value under 'OAuth policies' to 'Admin approved users are pre-authorized', and click Save.


2. To Give Access
Now, you want specific users able to access Workbench. There are 2 options:

a. Using Profile
All users in the profile will be able to access Workbench.
In the Workbench page under Connected Apps, scroll down to Profiles, click Manage Profiles button. Select all profiles that need to access Workbench, then click Save button.

b. Using Permission Set
Using Permission Set is more flexible, only users assigned with that permission set will be able to access Workbench.
But before configure in Connected Apps, you need to create a permission set without any permissions, then assign users to that Permission Set. Next, in the Workbench page under Connected Apps, scroll down to Permission Sets, click Manage Permission Sets button. Select all permission sets that need to access Workbench, then click Save button.


When a user without permission to access Workbench, the user will see an error message when try to login to Workbench OAUTH_APP_ACCESS_DENIED: user is not admin approved to access this app.




Monday, December 18, 2017

Salesforce Lightning App page not refresh

My experience when configuring Salesforce Lightning App page that related to UI (user interface) is not great, when I add a field in the page layout or adding components into Lightning App, it doesn't reflect immediately when I open a record. In many times, I need to refresh many times, even have to logout and login back. This experience never happens in Classic.

Is this a bug with Lightning Experience? Further checking this issue, I found this basically related to caching that implemented for Lightning Experience.

There is a setting under Setup | Session Settings called Enable secure and persistent browser caching to improve performance.


Once this caching disabled, I do not have that experience/issue anymore. Since this caching will improve user experience overall, so I do not suggest to disable in production, but only in Sandbox when you need to configure the user interface a lot.

From Salesforce documentation, enables secure data caching in the browser to improve page reload performance by avoiding extra round trips to the server. This setting is selected by default for all orgs. We don’t recommend disabling this setting. However, if your company’s policy doesn’t allow browser caching even if the data is encrypted, you can disable it.
We've added secure data caching in the browser to improve page reload performance by avoiding additional round trips to the server.

This feature is available in Lightning Experience only.


Reference:


Wednesday, December 13, 2017

Salesforce Lightning: Utility Bar

One of the benefits when you switching to Lightning is Utility Bar. Lightning Experience allows you to add your components to the prime real estate in any Lightning app so that your users have one-click access to powerful productivity tools, such as Recent items, Notes, Chatter feed and so on. Your users can access those same productivity tools in a horizontal footer, called the utility bar.

Utility bar gives your users quick access to common productivity tools. The utility bar is a fixed footer that opens components in docked panels. You can add multiple components to the utility bar, each Lightning Apps can have their own set of components in the utility bar. You also can add the same components many times in the utility bar within the same Lightning apps, this is because some of the components allowed you to select a different type of visibility, e.g. for Chatter Feed components, you can select Bookmarked, What I Follow, and To Me feed.


Utility bar will be available and visible for the users, no matter which page they are open, so this gives instant access to the components, this is even better compare to Classic, where you can add commonly used items in the Home page.

As of now Winter '18 release, Salesforce provide 13 standard components available for utility bar, but you can develop your owned components (need to enable My Domain) or install from AppExchange.


Reference:



Monday, November 20, 2017

Salesforce: Time field (Beta)

This blog is written with Winter '18 release, where time field still in Beta, let us expect many improvements in Spring '18 release and beyond. This feature is enabled by default in Sandbox, but you need to request Salesforce if you would like to enable it for the production.

This function has been requested in Idea Exchange since 10 years ago, and at this moment it has 5,530 points.

There are 2 types of Time fields in Winter '18 beta:
- as a Custom field with Data Type = Time, or
- as a Formula field with Return type = Time

1. Custom field with Data Type = Time
As of now, the display in Lightning is not great, but much nicer in Classic.


As this is not formula field, users with appropriate permission able to type in the time directly into the page layout.

In Classic, you can enter the time in 24 hours format:
- "18", when you save, this will save as 6:00 PM
- "18:12", when you save, this will save as 6:12 PM
- "7:12", when you save, this will save as 7:12 AM
- "7.32", when you save, this will save as 7:00 AM  --> 18.12 (dot) will be ignored

You also can enter the time in 12 hours format with AM/PM (in Classic):
- "12 AM", when you save, this will save as 12:00 AM
- "12:30PM", when you save, this will save as 12:30 PM

While in Lightning, you need to enter in pattern of HH:MM:SS, example: 07:30:00, or  19:00:00, once stored, it will display as 07:30:00.000Z or 19:00:00.000Z


2. Formula Field return Time
Sample: MINUTE(Approved_Time__c), HOUR(Approved_Time__c)
To calculate hours and minutes between time fields, you cannot just minus or add them directly, Submission_Time__c - Approved_Time__c will return error "Incorrect parameter type for operator '-'".

To display the difference between 2 times, you can use formula field to return the formula as text, example:
IF( (MINUTE(Approved_Time__c) - MINUTE(Submission_Time__c)) >=0,
TEXT((HOUR(Approved_Time__c) - HOUR(Submission_Time__c)))
& ":" &
TEXT((MINUTE(Approved_Time__c) - MINUTE(Submission_Time__c))),
TEXT((HOUR(Approved_Time__c) - HOUR(Submission_Time__c) - 1))
& ":" &
TEXT((MINUTE(Approved_Time__c) - MINUTE(Submission_Time__c) + 60))
)

To read the complete documentation, read this article, and if you have further questions, feel free to join Custom Time Field success community.

Update since Spring '18 release, now you can calculate time field to return Number, example:
End_Time__c - Start_Time__c
This formula will return the time difference in milliseconds; 1 hour = 3,600,000 milliseconds.



Reference:


Saturday, November 18, 2017

Enable Record Type with Permission Set

Back to the basic series - permission set for the record type access.

I had a discussion with a user group member, which is subject matter expert (Salesforce biz owner) in his company. He is using Record Type to differentiate Account Type, where the different type of Account has the different layout. This is a good usage of the record type. But, he also complains his workload because of a special record type that only able create by him as the biz owner, salespeople are not allowed to create this special type of Account, but only able to see.

He would like to give the ability to a sales support user ability to create that special Account type, let's call it "Not-normal" for this blog. But, he also not able to make that sales support user have the same Profile as him.

Solution: use Permission Set
Create a new permission set and assign it to that Sales support.
When you are in the Permission Set, select Object Settings, for the object (in this case is Accounts), you will see Account: Record Type Assignments and enable Not-normal record type.



Then assign the permission set to that sales support user, I'll not discuss how to assign the permission set in this blog, but you just need to click "Manage Assignments" button.






Tuesday, October 3, 2017

Salesforce: Lightning Mass Inline Editing in List View

Many years back, when we are still in Classic, we can enable Mass Inline Editing from the list view, read this blog Inline Editing in Salesforce List View for more info. However, when switching to Lightning, inline editing for list view is not available.

Until Winter '18 release, Salesforce adds this feature in Lightning. I have a use case where the list view works in some object, but not for other objects, example: the checkbox at the left shown in Lead, but not in Opportunity. However, when switching back to Classic, the checkbox appear for Opportunity. For sure, this is not about menu setup issue as it works in Lead objects in Lightning.

Further check, here is the cause, the checkbox at the left for Lightning only appear when A or B scenario below is fulfilled:

A. You can inline edit the list
1. If you have record type configured, the list view should filter with only one record type, and
2. There are fields in the list view which is editable, such as: not created date, created by, etc, and
3. No "OR" filter logic in the list view.

B. Mass action button
You have mass action button added to the list view tab, such as "Add to Campaign" button.
But, keep in mind around, if your custom mass actions buttons are Javascript, they'll show up and work in Classic but will not be visible in Lightning, as there is no mass action for the list view, the checkbox will not appeared too.




Notes: mass inline edit in Lightning is auto enabled since Winter '18 release, and it does NOT need to enable Enable Inline Editing and Enable Enhanced Lists from User Interface setup menu.


Reference: Edit More Records at Once with Mass Inline Editing



Page-level ad