Pages

Friday, June 24, 2016

Salesforce: Show value only to Owner and Manager


Use case:
A scoring system has been implemented to auto calculate if a lead is valid to pursue. But, the score should only visible to the record owner manager.

In Salesforce, we only can set field visibility using Field Level Security (FLS) which is based on Profile. But record owner manager have the same profile with the record owner, and the manager may owned a lead which he supposed not able to see the score, only the manager's manager able to see it.

Solution:
1. Set the score field not visible from all Profile with FLS
2. Create a formula field and make it visible to all Profile
IF( $User.Id = Owner.ManagerId, Score__c, null)

For other scenario, if only the owner and owner's manager should be able to see the score, use this formula:
IF( $User.Id = OwnerId || $User.Id = Owner.ManagerId, Score__c, null)



Salesforce Change Set


List of Component Type available in Change Set:
  • Action
  • Action Link Group Template
  • Apex Class
  • Apex Sharing Reason
  • Apex Trigger
  • App
  • Approval Process
  • Assignment Rule
  • Auth. Provider
  • Auto-Response Rule
  • Button or Link
  • CORS Whitelist Origin
  • Call Center
  • Communication Channel Layout
  • Compact Layout
  • Custom Console Component
  • Custom Field
  • Custom Label
  • Custom Metadata Type
  • Custom Object
  • Custom Permission
  • Custom Report Type
  • Custom Setting
  • Dashboard
  • Dataflow
  • Document
  • Email Template
  • Escalation Rule
  • External Data Source
  • Feed Filter
  • Field Set
  • Flow Definition
  • Folder
  • Global Picklist
  • Group
  • Home Page Component
  • Home Page Layout
  • Language Translation
  • Letterhead
  • Lightning Component Bundle
  • Lightning Page
  • List View
  • Matching Rule
  • Name Credential
  • Opportunity Split Type
  • Page Layout
  • Permission Set
  • Platform Cache Partition
  • Post Templates
  • Queue
  • Record Type
  • Remote Site
  • Report
  • Reporting Snapshot
  • Role
  • S-Control
  • Send Action
  • Sharing Criteria Rule
  • Sharing Owner Rule
  • Sharing Territory Rule
  • Site.com
  • Static Resource
  • Tab
  • User Provisioning Config
  • Validation Rule
  • Visualforce Component
  • Visualforce Page
  • Workflow Email Alert
  • Workflow Field Update
  • Workflow Outbound Message
  • Workflow Rule
  • Workflow Task
  • Zone
The one in purple is just to mark new components added since Summer'15 release.

Note:

Search Layouts is not available as independent Component in Change Set, but when you deploy the object, all Search Layouts for that object is included.

For Custom Settings, you need to re-create or export/import (e.g. using Data Loader) the data set/values in the target org, Change Set will only deploy the Custom Setting shell.

Custom Fields from Custom Settings will be treat as per normal Custom Fields from object.

The components available for a change set vary by edition. Some components require corresponding features to be enabled in your organization, such as: Sharing Territory Rule will not available if Territory  is not enabled. 

If you create or modify components that are not available in a change set, you can't send those components from one organization to another in a change set. In this case, migrate the changes manually by repeating the steps you performed when you created or modified the component.

List Views are visible to all users when you deploy a change set. Change the visibility in the destination organization as necessary. See more information related to List View for change set here List View not visible in Change Set.

Deployed custom tabs are hidden by default for all users. They’re visible only if the change set also contains profiles that set the visibility property appropriately. Professional Edition organizations are an exception—deployed custom tabs in those organizations are always visible by default.


Reference:

Friday, June 10, 2016

Salesforce: Convert Multi-Select Picklist to Text


Multi-Select Picklist is nice for user to use in Salesforce user interface, but there are many limitations for admin to use this type of field, because it support limited functions compare to other fields type.

More than a year ago, we blog about How to sort Multi-Select Picklist in View? This blog will share about how to convert Multi-Select Picklist to Text, so you can use it in many areas.

As of now (Summer '16 release), multi-select picklist only support following functions:
  • INCLUDES()
  • ISBLANK()
  • ISNULL()
  • ISCHANGED() - only in assignment rules, validation rules, workflow field updates, and workflow rules in which the evaluation criteria is set to Evaluate the rule when a record is: created, and every time it’s edited.
  • PRIORVALUE()only in assignment rules, validation rules, workflow field updates, and workflow rules in which the evaluation criteria is set to Evaluate the rule when a record is: created, and every time it’s edited.

With a simple formula field return text format, you can get the multi-select picklist values in Text.
Let say you have a custom multi-select picklist field called Country__c with 5 values. Here is the formula:
 IF( INCLUDES(Country__, 'Singapore'), 'Singapore,', null) +   
 IF( INCLUDES(Country__, 'Indonesia'), 'Indonesia,', null) +   
 IF( INCLUDES(Country__, 'Malaysia'), 'Malaysia,', null) +   
 IF( INCLUDES(Country__, 'China'), 'China,', null) +   
 IF( INCLUDES(Country__, 'Japan'), 'Japan,', null)   


Reference: Tips for Working with Picklist and Multi-Select Picklist Formula Fields


Thursday, June 9, 2016

Salesforce System Status Alert with IFTTT

Salesforce Trusthttp://trust.salesforce.com is the main area to monitor if any issues happened with your Salesforce org, but you need to know what is your Salesforce instance, for production instance, it start with NAxx, EUxx, and APxx, while CSxx for sandbox instances.

It is a good idea to have central place to monitor all instances, or your specific instances. For this blog I'll use sample instance NA17. We'll not always keep monitor that website - http://trust.salesforce.com/trust/instances/NA17, but I expect that Salesforce Trust will email me directly if any post related to my instance.

Solution: because Salesforce Trust also publish RSS feed, we can use this and combine with IFTTT.com to trigger send email. The same result can be achieved using other tools support rss feed to email such as: blogtrottr.com, but for this blog, we'll just use IFTTT.com

RSS Feed for NA17 = http://trust.salesforce.com/rest/rss/NA17
  1. Login or Signup to ifttt.com
  2. Create a Recipe
  3. Select if "Feed"
  4. Enter NA17 Feed URL: http://trust.salesforce.com/rest/rss/NA17
  5. Select then "Email"
  6. Leave the Subject and Body as default
  7. Done and you have your recipe running.



If any post related to NA17, IFTTT will send you email, see sample below: