Pages

Monday, August 8, 2016

#MVPChicago16 through my lens

CHICAGO | W Hotel | 18 - 19 July 2016


This would be my 3rd MVP event, here the re-cap for 2014 and 2015 Summit. It's always good to see MVP peeps from around the world in a place, and this time it is hold in Chicago, yay my first time visit this town.

I'll not write much about the event content as we are under NDA, but in very short, it is about lightning, Lighting, LIGHTNING !!!

Here are some great moments to share:

1st day - registration


with fellow Japanese MVPs


some of Asian MVPs

with #1 salesforce blogger

beach appreciation dinner


starting 2nd day







this is what we call Ohana

Navy Pier dinner




Thank you Salesforce for hosting and make this event happened, and yes Chicago is gorgeous !!!




Twitter hash-tag: #MVPChicago16


Blog from other MVP or Partner: Salesforce MVP Chicago SUMMIT 2016


Thursday, July 7, 2016

Getting Started with Salesforce Visualforce Email Template

Follow the wizard to create Visualforce email template from: SetupCommunication TemplatesEmail Templates | New Template and select Visualforce in Step 1 "Choose the type of email template you would like to create". You will get a basic Visualforce email template with Subject, Recipient Type (Contact, Lead, or User), and Related To Type Object.

<messaging:emailTemplate subject="Account Name" recipientType="User" relatedToType="Account">
<messaging:plainTextEmailBody >
Congratulations!
This is your new Visualforce Email Template.
</messaging:plainTextEmailBody>
</messaging:emailTemplate>



Few simple things you can modify the email template without programming:

1. Change subject to include merge field
Example: <messaging:emailTemplate subject="Account Name" recipientType="User" relatedToType="Account">
to
<messaging:emailTemplate subject="Account Name - {!relatedTo.Name}" recipientType="User" relatedToType="Account">

2. Add a ReplyTo address 
Example: <messaging:emailTemplate subject="Account Name - {!relatedTo.Name}" recipientType="User" relatedToType="Account">
to
<messaging:emailTemplate subject="Account Name - {!relatedTo.Name}" recipientType="User" relatedToType="Account" replyTo="support@acme.com">

3. Change Email format from Text to HTML
Example: <messaging:plainTextEmailBody > to <messaging:htmlEmailBody >

4. Add new line
As this is now HTML email, you can add <br/> for new line.

5. You can add recipient name
Example: <p>Dear {!recipient.name},</p>

6. You can add related field, including custom field
Example: Account Owner: {!relatedTo.CreatedBy.Name}<br/><br/>

7. You can add full URL as email body
Example: URL detail: <a href="{!LEFT($Api.Partner_Server_URL_370, FIND(".com/",$Api.Partner_Server_URL_370)+3)}/{!relatedTo.Id}">{!relatedTo.Name}</a>

8. You can add logic to include field
Example: <apex:outputPanel rendered="{!relatedTo.RecordType.Name='Customer' || relatedTo.RecordType.Name='Alumni'}">
Total Revenue: {!relatedTo.Total_Revenue__c}<br/><br/>
</apex:outputPanel>


Sample of complete email template:
<messaging:emailTemplate subject="Account Name - {!relatedTo.Name}" recipientType="User" relatedToType="Account" replyTo="support@acme.com">
<messaging:htmlEmailBody >
<p>Dear {!recipient.name},</p>
Account Owner: {!relatedTo.CreatedBy.Name}<br/><br/>

<apex:outputPanel rendered="{!relatedTo.RecordType.Name='Customer' || relatedTo.RecordType.Name='Alumni'}">
Total Revenue: {!relatedTo.Total_Revenue__c}<br/><br/>
</apex:outputPanel>

URL detail: <a href="{!LEFT($Api.Partner_Server_URL_370, FIND(".com/",$Api.Partner_Server_URL_370)+3)}/{!relatedTo.Id}">{!relatedTo.Name}</a>

</messaging:htmlEmailBody>
</messaging:emailTemplate>


For advance page with apex controller, you can use Visualforce Component, and use apex class as Controller.
Example: <c:AccountNotification AcctId="{!relatedTo.Id}"/>

In the component specify the apex class as controller
<apex:component controller="AccountEmailNotify" access="global">
</apex:component>


Reference:

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:




Page-level ad