Pages

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.


ReferenceEdit More Records at Once with Mass Inline Editing



Wednesday, September 27, 2017

Salesforce: Files Visibility and Actions

We shared about Files Sync in the previous blog, where we can have two-ways sync from Salesforce with desktop computers, also ability to "create" folder structure from desktop computers which will be synchronized to Salesforce.

Next question, once I have my file in Salesforce, who can see my Files? Only me? Or someone else in the company will able to see my files?.

Your files in Salesforce can be private to you, privately shared, or visible to your entire company.
Sharing SettingDefinitionWhen Does a File Have This Setting?
Private PrivateThe file is private. It hasn't been shared with anyone else besides the owner. The file owner and users with “Modify All Data” permission can find and view this file. However, if the file is in a private library, only the file owner has access to it.A file is private when you:
  • Upload it in Files home
  • Publish it to your private library
  • Sync a file in your Salesforce Files Sync folder
  • Stop sharing it with everyone (Make Private)
  • Delete posts that include the file and the file isn't shared anywhere else
Privately Shared Privately SharedThe file has only been shared with specific people, groups, or via link. It's not available to all users in your company. Only the file owner, users with “Modify All Data” or “View all Data” permission, and specific file viewers can find and view this file.A file is privately shared when it's:
  • Only shared with specific people or a private group
  • Posted to a private group
  • Shared via link
  • Posted to a feed on a record
  • Published to a shared library
Company-wide Your CompanyAll users in your company can find and view this file.A file is shared with your company when it's posted to a feed that all users can see, a profile, a record, or a public group.

When a file sharing is private, only the file owner (the one who upload the file) and users with Modify All Data permission (this includes your System Administrators) will able to see the file, but not for users with View All Data permission. However, for Privately Shared files, users with "View all Data" permission will be able to see it.

Here actions user can do with the file by file owner, collaborator and viewer:
ActionFile OwnerFile CollaboratorFile Viewer
View or PreviewYesYesYes
DownloadYesYesYes
ShareYesYesYes
Attach a File to a PostYesYesYes
Sync a FileYesYesYes
Upload New VersionYesYes
Edit DetailsYesYes
Change PermissionYesYes
Make a File PrivateYes
Restrict AccessYes
DeleteYes


Make file Private
When you have a file has been shared with many people or groups, you can "restore" it back as private by clicking "Make Private" link from Sharing Settings (unfortunately until Summer '17 release, this only available in Classic, and not in Lightning)



Prevent others from sharing and unsharing
You have files shared to other user or group, Salesforce offers a function not to allow other users to share it. There is a box in file sharing setting called "Prevent others from sharing and unsharing", tick this box to enable it.



Let's see from user experience when accessing the files shared with them, the first one is the default where they are allowed to share with other users, and the second screenshot when the file owner enable the option not allowed to share:

this is normal file shared to another user (2nd file)

when the owner makes the file not shareable (1st file)


File Privacy on Records
Before Winter '18 release, all files on records in Lightning Experience were visible to everyone with access to the record. Winter '18 release introduces "File Privacy on Records" option, when the option selected is "Private on Records" in Lightning Experience and communities, the file will be not visible to all user able to access the record, it will be behavior as Private sharing file.

Only file owners and administrators have the power to change the value of File Privacy on Records.
A file marked as private in Lightning Experience is also private in Salesforce Classic. Admin needs to add File Privacy on Records field into Content Version object page layout in the Setup menu.



Reference:


Tuesday, September 26, 2017

Salesforce: Files Sync

Salesforce Files Sync lets you store your documents in the cloud and access them from any device: your computer, laptop, phone or iPad. You'll never again have to wonder where you left the current version - anywhere you access the file it will be up to date!

Files Sync is a desktop agent to sync files and folders from your computer with Salesforce Files. This is pretty similar to other providers such as Dropbox, Microsoft OneDrive, Box, and etc, where you can sync files and access it from anywhere, any devices, but also from Salesforce.

Here are few benefits using Files Sync:
- The files are stored in Salesforce platform
- The files are accessible from Salesforce1 mobile, and computers with sync agent installed
- No additional cost, it comes along with your Salesforce license
- 10 GB storage for each user
- Create folder and subfolders from desktop (computer)
- You can choose files in Salesforce to be synced, so not all Files will be synced by default.

I have a unique case, this company is blocking file hosting service, including their sync agent software, such as Dropbox, OneDrive and etc. However, Salesforce is a legitimate application used by the company, so Files Sync is the only one will work for syncing files.


Here are few steps to configure Files Sync:

1. Enable Files Sync
From Setup | Feature Settings | Salesforce Files | General Settings, select Enable Files Sync.


Once this enabled, you should see Sync Files permission under Profile or Permission Set.


2. Grant Users Access
The Sync Files permission need to assign to users, this can be done through Profile or Permission Set.


3. Install Salesforce Files Sync
The user needs to install Files Sync agent to their computer. Download the installer from personal settings, enter Files Sync in the Quick Find box, then select Salesforce Files Sync. Available for both Windows and Mac OS X.


Follow the installation instructions for your operating system, then log in with your Salesforce credentials.


4. File Upload and Download Security (Optional)
From Setup, enter File Upload and Download Security in the Quick Find box, then select File Upload and Download Security.

This is to control how various file types are handled during upload and download. Select Don't allow HTML uploads as attachments or document records" to prevent users from uploading files that can pose a security risk.



Notes:
1. When the user has Sync Files permission enabled and desktop agent installed and log in, she or he will see additional column Sync in Classic, this is not available yet in Lightning (Summer '17 release).

before

after


2. Additional "Synced" menu is added to the menu under Files tab.



3. The user can sync file from Salesforce by clicking sync icon next to the file, this is not available yet in Lightning (Summer '17 release).



4. When sync agent in the desktop is working properly, the icon in taskbar should be the blue-white cloud with checked. If it is in blue-black cloud, something is wrong, either the user does not have permission for Files Sync, or the Org. has not been enabled for Files Sync. Right-click the icon and select "Sync Status..." for more information.

working properly 

something wrong


5. When you overwrite the file in a computer which syncs to Salesforce, the file version history is maintained by Salesforce, you can retrieve the older versions from Content details page.



Reference:


Sunday, September 10, 2017

Salesforce: Mass Upload Products

Almost two years ago, we wrote a blog related to Product in Salesforce, continue with another blog to assign Product to Price Book, and on adding Product to Opportunity.

In this blog, we will share about step by step to add Product to existing Price Book.

1. Add New Product 
From Lightning, select Products tab. If you do not see Product tab, use following URL and parameters: one/one.app?source=aloha#/sObject/Product2/list?filterName=Recent
Enter all information for product and make sure Active is ticked.



2. Add Product to Standard Price Book
  • Open the product created. 
  • Click Related tab.
  • Looks for Price Book, then click "Add Standard Price" button. By default, Standard Price Book is selected. In many cases, we do not use Standard Price Book, so you may just select other price books at this window, but you will get error message No standard price defined for this product, this is because we need to have the standard price for the product, even we do not use it.
  • Select Standard Price Book, if you have multi-currency enabled, make sure to select correct Currency, also make sure Active is ticked.
  • Click Save button.


3. Add Product to real Price Book
  • From the screenshot in step 2, once Standard Price Book is added, you will see 'Add to Price Book' button. 
  • Select the Price Book and Currency.
  • If you need to add into multiple currencies, you need to repeat step 2 above multiple times.
  • Enter the List Price of the Product for that Price Book.
  • Click Save button.


Mass Upload Products
If you need to load many products, manual steps as above are not efficient. The solution is the use Data Loader to mass load the products and assigned to the relevant price book. 

The step using Data Loader are similars with manual steps as above:
1. Load products to Product2 object.
2. Assign product to Standard Price Book, get Standard PriceBookId for PricebookEntry object.
3. Assign product to real Price Book, get the real PriceBookId for PricebookEntry object.



Reference:



Tuesday, July 25, 2017

Salesforce: Edit Converted Leads

If you have used Salesforce for a quite long time, you may aware that once a Lead is converted, you will not able to view the lead detail, except with report, and will not able edit it, even using API.

But, since Spring '16 Release, a user with special permission will be able to view and even edit the converted lead, directly in Salesforce page. This is a good move, in many cases Sales Ops or super user needs to edit some details in the converted lead.

In the previous blog Set Audit Fields upon Record Creation, we discussed a new permission for user able to populate Create Date, Create By, etc., but a user with the same permission "Set Audit Fields upon Record Creation" will be able to edit a converted lead too.

Thanks to Daniel Peter for pointing a new permission "View and Edit Converted Leads" introduced in Spring '17 Release, this permission reduces "Set Audit Fields upon Record Creation" permission just for the purpose of set audit fields on the record creation. I personally see this is a great approach in separating the permissions, because of the different usage.

Let's see a converted Lead in Classic, even we manually type in the URL, example: https://ap2.salesforce.com/00Q28000002fPqZ, it will be auto redirect to https://ap2.salesforce.com/p/lead/ViewConvertedLead/d?id=00Q28000002fPqZ



But, let's see when a user with "Set Audit Fields upon Record Creation" permission opens the same lead:


This user, able to see and even edit the record from Salesforce page.


Now, let's see what will be happened in Lightning for the same users. For the 1st user without Set Audit Fields upon Record Creation permission, the page will be auto redirect to the converted Contact.



While for the 2nd user with Set Audit Fields upon Record Creation permission, it will stay at the Lead page, so user able to view, and even edit the converted lead.



Editing converted Lead:




Reference:



Monday, July 24, 2017

Salesforce: Set Audit Fields upon Record Creation

More than 3 years ago, I wrote a blog Load Created By, Created Date, Last Modified By, and Last Modified Date (Audit Fields) on how to upload system fields, such as: Created By, Created Date, Last Modified By, and Last Modified Date in Salesforce. Usually, we need to do this as part of the data migration activity, where those fields are also known as Audit Fields in Salesforce.

Since Winter '16, Salesforce introduces a permission called Set Audit Fields upon Record Creation. By default, a standard profile will not have this permission enabled, such as for System Administrator profile, so you have to create a Permission Set with that permission, then assign the users with that Permission Set.

But, if you do not see this permission, navigate to Setup | Customize | User Interface, and look for a checkbox Enable "Set Audit Fields upon Record Creation" and "Update Records with Inactive Owners" User Permissions", make sure this checkbox is checked.
If you untick this option, the permissions will be disappeared, even it is selected in Permission Set and has been assigned to users.

Once you assigned with "Set Audit Fields upon Record Creation" permission, you should see audit fields like CreatedById, CreatedDate in API tools, such as: Data Loader, Workbench, etc.


This is before have "Set Audit Fields upon Record Creation" permission.



This is after have "Set Audit Fields upon Record Creation" permission.




Reference




Friday, July 21, 2017

Salesforce: Subscribe Reports in Classic and Lightning

Image result for report

In Salesforce, users with permission to subscribe report will be able to subscribe reports that user able to run (up to 5 reports). Once you subscribe reports, you will receive notifications that keep you informed about metrics you care most about without having to manually run reports. In Salesforce Classic, you can specify criteria that trigger report notifications.

Subscribe to Get Refreshed Report Results in Lightning Experience
Subscribe yourself and other people to up to 5 reports to receive refreshed report results by email on a schedule that you set: daily, weekly, or monthly.

Subscribe to Get Report Notifications in Salesforce Classic
In Salesforce Classic, Subscribe to a report to receive report notifications periodically when the metrics you care about most meet certain conditions. Set the conditions that trigger notification, and specify if you want to be notified via Salesforce1 notifications, Chatter, or email.

Limitations:

Identify Reports Subscribed
After a while, you will forget which all reports you have been subscribed, follow below steps to identify them:

In Lightning:
  1. Click "Reports" tab
  2. Click "All Reports" menu at the left
  3. Click "Subscribed" header column
  4. You will see all reports you subscribed with tick in Subscribed column
In Classic:
  1. Click "Reports" tab
  2. Click "All Folders" menu at the left (above "Unfiled Public Reports" folder)
  3. Select picklist "Items I'm Subscribed to" at the right and "All Type" the next dropdown
  4. This will filter all reports you subscribed

Reference:


Wednesday, June 28, 2017

Salesforce: Territory Management [1]


Territory management maybe not so popular used by many Salesforce users, but it is out of the box functions from Salesforce and supported by Salesforce. Territory management is not enabled by default in Salesforce, you need to contact Salesforce support to request territory management enable for your organization.

Territory management is an account sharing system that grants access to Accounts (including Opportunities and Cases associated with Account) based on the characteristics of the accounts. It enables your company to structure your Salesforce data and users the same way you structure your sales territories.

At this moment (Summer '17 release), there is 2 type of Territory Management in Salesforce and both are active and supported by Salesforce:
1. Territory Management, aka TM 1.0 (original version)
2.  Enterprise Territory Management, aka TM 2.0 (newer version)


Lightning Support
Territory Management
Original Territory Management appears in the Lightning Experience Setup tree. From there, you can enable, configure, and maintain the feature. Territory information, assignments, and reports are available and viewable in Salesforce Classic only.

Enterprise Territory Management
To set up Enterprise Territory Management, create or update territory assignment models or rules, assign territories to records, or view territory assignments, switch to Salesforce Classic. However, access control on records managed by Enterprise Territory Management settings is respected in Lightning Experience.


Forecast
Territory Management
Territory Management is available only with Customizable Forecasts and is not supported with Collaborative Forecasts. If original Territory Management is enabled, you can no longer use Collaborative Forecasts.

Enterprise Territory Management
Enterprise Territory Management can’t be used with Customizable Forecasts. Enterprise Territory Management and Collaborative Forecasts can both be enabled and used at the same time in your Salesforce organization, but the two features are not currently integrated to work together. Forecast is optional, so you can have TM 2.0 without enabling Collaborative Forecasts.


If you have Territory Management enabled and not sure if you are on Territory Management or Enterprise Territory Management, check this:
1. Territories setup menu
From Classic, navigate to SetupAdminister | Manage Territories, if you see Settings, Territory Types, and Territory Models, you have Enterprise Territory Management enabled. But, if you see Territory Settings and Territory Hierarchy menu, you are using Territory Management.

2. Forecast setup menu
From Classic, navigate to Setup | Customize, if you see Forecasts (Customizable) menu, you have Territory Management enabled. But, if you see Forecast menu, you are using Enterprise Territory Management. If you do not use Forecast at all, you may not see it there.


I'll share further on Territory Management in next blog.


Reference:


Tuesday, May 30, 2017

Salesforce: List View SharedTo

As per API 39.0, looking at ListView object, we can't retrieve who can access a list view with simple SOQL query. But, looking at this metadata API documentation, we can retrieve who can access a list view using sharedTo field. We can use a SOQL query for this, as this is metadata API.

Here is the step by step to retrieve that info, you will need to use Workbench.
Let's say we would like to check who can access a list view called "Account start A".

1. Get the "fullName"
From Workbench:
- select Info | Metadata Types & Components
- select Listview from the dropdown
- click Expand all and find the view name
- if the view is "Visible only to me", you will not find it here


2. Prepare XML file
Copy following XML and save it to a file called "package.xml"
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Account.Account_start_A</members>
        <name>ListView</name>
    </types>
    <version>39.0</version>
</Package>

3. Retrieve Package
Open workbench again:
- select migration | Retrieve
- select the XML file prepared in step 2
- tick "Single Package"
- click Next button
- click Retrieve button
- when done click Download ZIP File link
- extract the zip file
- look for object folder
- in my case, this is account object, so open "Account.object" file with any text editor
- here is the result, you will easily see who have access to the view

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <listViews>
        <fullName>Account_start_A</fullName>
        <columns>ACCOUNT.NAME</columns>
        <columns>ACCOUNT.SITE</columns>
        <columns>ACCOUNT.ADDRESS1_STATE</columns>
        <columns>ACCOUNT.PHONE1</columns>
        <columns>ACCOUNT.TYPE</columns>
        <columns>CORE.USERS.ALIAS</columns>
        <filterScope>Everything</filterScope>
        <filters>
            <field>ACCOUNT.NAME</field>
            <operation>startsWith</operation>
            <value>A</value>
        </filters>
        <label>Account start A</label>
        <language>en_US</language>
        <sharedTo>
            <group>Coba_Group</group>
            <role>CEO</role>
            <role>CFO</role>
            <role>COO</role>
        </sharedTo>
    </listViews>
</CustomObject>


Let's extend this to retrieve for many list views, modify the package XML file as below:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Account.Account_start_A</members>
<members>Account.NewThisWeek</members>
<members>Account.RT_Ke2</members>
        <name>ListView</name>
    </types>
    <version>39.0</version>
</Package>

This is the sample result:
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <listViews>
        <fullName>Account_start_A</fullName>
        <columns>ACCOUNT.NAME</columns>
        <columns>ACCOUNT.SITE</columns>
        <columns>ACCOUNT.ADDRESS1_STATE</columns>
        <columns>ACCOUNT.PHONE1</columns>
        <columns>ACCOUNT.TYPE</columns>
        <columns>CORE.USERS.ALIAS</columns>
        <filterScope>Everything</filterScope>
        <filters>
            <field>ACCOUNT.NAME</field>
            <operation>startsWith</operation>
            <value>A</value>
        </filters>
        <label>Account start A</label>
        <language>en_US</language>
        <sharedTo>
            <group>Coba_Group</group>
            <role>CEO</role>
            <role>CFO</role>
            <role>COO</role>
        </sharedTo>
    </listViews>
    <listViews>
        <fullName>NewThisWeek</fullName>
        <columns>ACCOUNT.NAME</columns>
        <columns>ACCOUNT.CREATED_DATE</columns>
        <columns>Record_Type_Name__c</columns>
        <filterScope>Everything</filterScope>
        <filters>
            <field>ACCOUNT.CREATED_DATE</field>
            <operation>equals</operation>
            <value>THIS_WEEK</value>
        </filters>
        <label>New This Week</label>
        <language>en_US</language>
    </listViews>
    <listViews>
        <fullName>RT_Ke2</fullName>
        <columns>ACCOUNT.NAME</columns>
        <columns>ACCOUNT.SITE</columns>
        <columns>ACCOUNT.ADDRESS1_STATE</columns>
        <columns>ACCOUNT.PHONE1</columns>
        <columns>ACCOUNT.TYPE</columns>
        <columns>CORE.USERS.ALIAS</columns>
        <filterScope>Everything</filterScope>
        <filters>
            <field>ACCOUNT.RECORDTYPE</field>
            <operation>equals</operation>
            <value>Account.AccRtKe2</value>
        </filters>
        <label>RT Ke 2 Manual</label>
        <language>en_US</language>
        <sharedTo>
            <group>All_Internal_User_Group</group>                               <roleAndSubordinates>ChannelSalesTeam</roleAndSubordinates>
        </sharedTo>
    </listViews>
</CustomObject>

From the XML returned:
- the 1st view "Account_start_A" is shared to 1 group and 3 roles
- the 2nd view "NewThisWeek" is visible to all users, therefore there is no sharedTo tag
- the 3rd view, "RT_Ke2" is shared to 1 group and 1 role with subordinates.

Let's randomly confirm if the return is correct:



Additional notes:
With REST explorer from Workbench, we can get data of list view, example:
- to get all list view in Account: /services/data/v39.0/sobjects/Account/listviews/

- to get list view data from a list view:
/services/data/v39.0/sobjects/Account/listviews/00B50000008DouiEAC/results

* 00B50000008DouiEAC is ListView ID



Reference:
Metadata API Developer Guide - ListView
Force.com REST API Developer Guide - List Views