Pages

Showing posts with label Tips. Show all posts
Showing posts with label Tips. Show all posts

Friday, October 21, 2022

Salesforce Lightning URL Hack

Scenario: Universal Inc would like to increase staff productivity with fewer clicks when creating a Case from the Account page, users still need to enter other fields, but a few fields have been populated by default:

  • Skip record type prompt
  • Type = Other

Solution: create a custom button and add it to the page layout. Here is the URL:

/lightning/o/Case/new?defaultFieldValues=RecordTypeId=0125g0000022dlQAAQ,AccountId={!Account.Id}&Type=Other


Reference:

Thursday, June 30, 2022

Salesforce: Query Org ID and Sandbox

You can get your salesforce Org ID and other info from Company Information in the Setup menu. But, if you need to get the data from SOQL, here is the sample query

SELECT Id, Name, InstanceName, DefaultLocaleSidKey, TimeZoneSidKey FROM Organization


While for Sandbox info, you can go to the Sandboxes in the setup menu in Prod. The same, you can use SOQL to get the information, but you need to use Tooling API. 
SELECT Id, SandboxName, Description, LicenseType, HistoryDays FROM SandboxInfo

The Id returned here is SandboxInfo ID, not the Org ID and unfortunately, we can't get the Org ID.



You will get the same result if perform query with Rest Explorer from Workbench
GET /services/data/v53.0/tooling/query/?q=+Select+Id,SandboxName,LicenseType,Description+from+SandboxInfo



Reference:

Thursday, March 31, 2022

Remove Personal Information when sharing Office documents

Microsoft Office by default documents stores your personal information when creating or editing an office document. You can remove that information like comments, version history, and metadata containing personal information like document author, and date of creation, before sharing the file with other people externally. The Document Inspector feature in Word, Excel, PowerPoint, or Visio can help you find and remove hidden data and personal information in documents that you plan to share.

For Windows

  1. In an open Word document, click File then Info.
  2. Select Check for Issues and choose Inspect Document to control what type of content you want to be flagged.
  3. To start your search, click Inspect and then Remove all the information you want to be edited from your content.

Repeat the process by clicking the Reinspect and Remove all buttons until your document is clean. Click the Close button to save your changes







Monday, February 18, 2019

Using Emoji in Salesforce

Nowadays, emoji is widely used from mobile device messaging, email, until more serious business applications such as Salesforce. If you don't have emoji keyboard, you can copy varieties of emoji from the internet, one of the most famous is emojipedia.org



As per this article 5 Ways You Can Use Emoji, you can use emoji in Salesforce, from:
- Chatter Post
- Validation Rules
- Help text
- Formula field
- Picklist values
- Field value
- List view

Emoji in Salesforce works in both Lightning and Chatter.





Reference:

Wednesday, September 5, 2018

Case-sensitive VLOOKUP for Salesforce Record Id

Salesforce record Id will always return 15 characters across all objects, and the Id is case sensitive. Of course, if you have admin access, you can create a formula field CASESAFEID(Id) and this will return 18 characters which are case-insensitive.

But, if you have to work with case-sensitive 15 characters and do VLOOKUP in Excel, you need to do extra work, as you probably know that one of the limitations of VLOOKUP is case-insensitive, it means the case is not a consideration in the lookup process, example: 0038000001c9YsM is essentially the same as 0038000001c9Ysm. Hence, VLOOKUP will consider that they are the same and return the first matched, which is totally wrong.

There are a few options you can do for VLOOKUP:

1. Convert 15 to 18 characters
We have shared this in a blog Convert ID from 15 to 18 characters with Excel formula, so you need to have an additional column in the source and lookup data, and use that column for VLOOKUP.

2. Convert to ASCII
This is pretty similar to option 1 above, instead of converting 15 characters case-sensitive to 18 characters case-insensitive, we convert the record Id into ASCII using CODE()Microsoft Excel CODE function returns the ASCII value of a character or the first character in a cell.

=CODE(MID(A2,1,1)) & CODE(MID(A2,2,1)) & CODE(MID(A2,3,1)) & CODE(MID(A2,4,1)) & CODE(MID(A2,5,1)) & CODE(MID(A2,6,1)) & CODE(MID(A2,7,1)) & CODE(MID(A2,8,1)) & CODE(MID(A2,9,1)) & CODE(MID(A2,10,1)) & CODE(MID(A2,11,1)) & CODE(MID(A2,12,1)) & CODE(MID(A2,13,1)) & CODE(MID(A2,14,1)) & CODE(MID(A2,15,1))

You need to convert both source and column data Record Id to ASCII, then use it for VLOOKUP().


Reference:



Friday, March 23, 2018

Salesforce: Convert ID from 15 to 18 characters with Excel formula


CASESAFEID() will return 18 characters ID from original 15 characters ID, the main difference is: 15 characters ID is case sensitive, while 18 characters ID is case insensitive. The issue will arise when using 15 characters ID when your teams working in Excel for data analysis, VLOOKUP() of Excel will not work properly, as it is case insensitive, so the best is to use 18 characters ID which is case insensitive.

But, if you are not the system admin or do not have permission to create a custom field to use CASESAFEID() for case-insensitive 18 characters ID, you can copy and paste the 15 characters ID using this online tool from admin booster to produce the 18 characters ID.

The other option and this is very useful when you have a lot of rows in Excel that needs to convert the ID from 15 to 18 characters is to use Excel formula. The formula below is copied from Salesforce developer forum, just change A2 with the excel cell of 15 characters ID.

=CONCATENATE(A2,
MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345",(
IFERROR(IF(FIND(MID(A2,1,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,1,0),0)
+IFERROR(IF(FIND(MID(A2,2,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,2,0),0)
+IFERROR(IF(FIND(MID(A2,3,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,4,0),0)
+IFERROR(IF(FIND(MID(A2,4,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,8,0),0)
+IFERROR(IF(FIND(MID(A2,5,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,16,0),0)
+1),1),
MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345",(
IFERROR(IF(FIND(MID(A2,6,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,1,0),0)
+IFERROR(IF(FIND(MID(A2,7,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,2,0),0)
+IFERROR(IF(FIND(MID(A2,8,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,4,0),0)
+IFERROR(IF(FIND(MID(A2,9,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,8,0),0)
+IFERROR(IF(FIND(MID(A2,10,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,16,0),0)
+1),1),
MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345",(
IFERROR(IF(FIND(MID(A2,11,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,1,0),0)
+IFERROR(IF(FIND(MID(A2,12,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,2,0),0)
+IFERROR(IF(FIND(MID(A2,13,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,4,0),0)
+IFERROR(IF(FIND(MID(A2,14,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,8,0),0)
+IFERROR(IF(FIND(MID(A2,15,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,16,0),0)
+1),1))


ReferenceFormula Field: calculating the 18-digit ID from the 15-digit ID



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, 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 5, 2016

Salesforce: Child Implicit Sharing

In the previous blog, we discussed Parent Implicit Sharing, let's discuss Child Implicit Sharing now.

Child Implicit Sharing is the ability of the Account owner, even if the user does not have access to the child record as defined in that child record.

Child Implicit Sharing also applies to the Account team, if the user is added as an account team member and given access to relevant child access (contacts, opportunities, and cases).



Querying the child Share object, such as OpportunityShare, you will see the RowCause as ImplicitChild.

Example: SELECT Id, UserOrGroupId, OpportunityAccessLevel, RowCause FROM OpportunityShare WHERE UserOrGroupId = '00580000001ren7AAA' AND OpportunityId = '0062H00001ESrWYQA1'



For the account owner, the account owner's role determines the level of access to child records (read-only or read/write). The same scenario is also applicable to users above the Account owner in the role hierarchy.


The above screenshot is taken from org. with all contact, opportunity, and case sharing settings "Private". If Contact sharing is "Controlled by Parent", you will not see Contact access here - the account owner will have full access to the Contact, even if the Contact is owned by another user.

Object (contact, opportunity, and case) with sharing "Public Read/Write" will also not be shown here, because all users have permission to read and edit the records.


Since the Winter '24 release, salesforce introduced Faster Account Sharing Recalculation, where the sharing access is not stored in CaseShare, ContactShare, or OpportunityShare object, but is determined when the user accesses the record; query to those objects will return zero records. You can use UserRecordAccess or look at the AccountShare to determine access.



Friday, November 4, 2016

Salesforce: Parent Implicit Sharing


In addition to the sharing setting defined by the system admin, the Salesforce platform also has built-in sharing behaviors between parent and child records. This sharing is called implicit sharing because it is not configured by administrators but defined and maintained by the platform.

Implicit sharing is automatic. You can neither turn it off nor turn it on — it is native to the platform. In other words, it isn't configurable; however, it's very important to understand how it works.

Parent implicit sharing provides read-only access to parent record (Account) when the user has read/write or read-only access in a child record (Opportunity, Case, or Contact) through child record ownership, sharing rule, or added as a team member (Opportunity Team or Case Team). 
For example, Account A has 3 contacts; if user X has access to one (or more) of the contacts of Account A, user X will be able to access the Account as read-only.
If the user has access to the child record via object permission (in Profile or Permission Set), the parent implicit sharing does not apply.

Parent implicit sharing only gives read-only access to the Account; for example, if A is the owner of an opportunity, parent implicit sharing will not give A access to ALL Contacts and Opportunities under the same Account.

Opportunity Contact Role
Parent implicit sharing does not apply by adding Contact Roles in the Opportunity. Adding Contact Roles to the Opportunity will not allow the Contact owner to have access to the Account.

Related Contacts
Parent implicit sharing does not apply by adding Contact as a Related Contact to an Account (indirect). Adding a contact as a Related Contact will not allow the Contact owner to have access to the Account.

Lookup Relationship
When the user has access to a record from other objects (NOT Opportunity, Case, or Contact) with a Lookup relationship to the Account, the user will see the Account Name only, but not the Account detail—this includes Account lookup to the Parent Account; the child account owner will see the Parent Account Name only.


The same behavior applies to lookup from other objects, including custom objects. For the Master-Detail relationship, the child record does not have an owner, so it is not applicable in this scenario.


If we look from the back end at how this is stored, there is an object called AccountShare. This object stores all the defined and implicit sharing. It also has RowCause, which tells us the reason that this sharing entry exists.

One of the values is ImplicitParent — the User or Group has access because they’re the owner of or have shared access to records related to the account, such as opportunities, cases, contacts, contracts, or orders -- so, it is not always the owner of the record, but as long as the user has access to the child records via sharing rules.

sample query: SELECT Id, AccountId, UserOrGroupId, AccountAccessLevel, CaseAccessLevel, ContactAccessLevel, OpportunityAccessLevel, RowCause FROM AccountShare WHERE UserOrGroupId = '0053400000AAkhz' AND AccountId = '0013400001RhrP3'



Wednesday, November 2, 2016

Salesforce: Use Colon for Report name


This tip is a quote from Salesforce success community #TipsTuesday "Using a colon in a report name places text before the colon on one line and text after the colon on another. This looks nicer and keeps reports with different names that need to be together, sorted together."

To keep this awesome tips, I share the tip with everyone from my blog and not buried in the forest of success community.

Here is normal Salesforce report naming.



When we add: in the report name, this is how it looks like when you or your user run the report, notice the different.



Let's look how we save it from Report Properties.



Note:
- this tip is not applicable to Dashboard.
- this also do not work in Lightning report


Last updated: 8 May 2017


Reference:


Wednesday, September 21, 2016

Salesforce: Password Expiration Date


So you set user passwords expire in 90 days, under SetupSecurity Controls | Password Policies, or under Password Policies in Profile.

Everything is working fine, all users must change password when login to Salesforce if password age reach 90 days or more.

With simply run a new report using User report type, you can check when a user need to change his/her password. Notice a field called Password Expiration Date.

In normal scenario, Password Expiration Date > Last Login. But, we notice there are a few users with Last Login > Password Expiration Date, is this mean those users able to skip password change when login to Salesforce?



Why this happened? After learn and investigate on this, here is the caused:
User is not login to Salesforce.com web, but they login from API, such as: Salesforce for Outlook, Salesforce1 app, Chatter Desktop, or others. To find out the "true" login to Salesforce.com website, down Login History, filter to that user and Login Type = Application.

Let's see two users from above screenshot:

User-1
Here is recent user login history, last login 9/21/2016 which is aligned with above report.



Filter Login Type = Application, user real last login to Salesforce.com web is 8/13/2016, while Password Expiration Date is 8/22/2016, so this is correct that user never login to Salesforce.com web after 8/22/2016.


User-2
Here is recent user login history, last login 8/12/2016 which is aligned with above report.



Filter Login Type = Application, user real last login to Salesforce.com web is 7/5/2016, while Password Expiration Date is 7/31/2016, so this is correct that user never login to Salesforce.com web after 7/31/2016.


Summary: Last Login in user report is not about just login to Salesforce.com, but it can be from other app / devices and that login method will not ask user to change password.


Other Notes:
  • Create/refresh Sandbox do not change the Password Expiration Date.
  • When user change his/her Salesforce password before Password Expiration Date, this will reset and re-count Password Expiration Date to a another x days, for this blog sample is 90 days.
  • New user created will have Password Expiration Date before Created Date, so user have to change password when login to Salesforce for the first time.




Friday, September 16, 2016

Salesforce: SystemModstamp

There is one standard field in Salesforce that many of us not aware of, and not really use it, it is available in standard and custom object which is called as SystemModstamp. So what is SystemModstamp field? It is a date time field. Is this similar with LastModifiedDate? Yes in common, but sometimes it may differ.

LastModifiedDate is the date and time when a record was last modified by a user.
SystemModstamp is the date and time when a record was last modified by a user or by an automated process (such as a trigger). In this context, "trigger" refers to Salesforce code that runs to implement standard functionality, rather than an "Apex trigger".

As a result, LastModifiedDate and SystemModstamp will differ when automated processes update the records, which will happen in the following scenarios (asynchronously in some cases):

a) The archive date is extended to greater than 365 days.
b) An existing picklist value is updated (not replaced with an existing picklist value).
c) A contact's e-mail address is flagged as per the Email Bounce Management configuration.
d) The LastActivityDate field is modified
e) Roll-up summary field is created, which will update all the parent records' SystemModstamp asynchronously. Recalculation will also take place if the Summary Type is updated.
f) Some Salesforce Internal backend processes also update SystemModstamp as SystemModstamp is used internally to signal that a record (or related data) may have changed and that internal processes may need to synchronize themselves to the new record data.

Sample
I have a custom picklist field in Account called Brand__c. I will change one of the picklist value from Toyota to Honda. This field is also set for tracking. 
Before I do that, let me query all the records where brand is Kia 
SELECT Id,Name,Brand__c,LastModifiedDate,SystemModstamp FROM Account WHERE Brand__c = 'Toyota' ORDER BY LastModifiedDate


As you see here, all records have LastModifiedDate = SystemModstamp

Now, let me update the picklist value from Toyota to Honda. Salesforce by default will auto update all records where Brand__c match Toyota to Honda. 
Then let's do another query.
SELECT Id,Name,Brand__c,LastModifiedDate,SystemModstamp FROM Account WHERE Brand__c = 'Honda'

Notice here that SystemModstamp is updated, but LastModifiedDate stay the same. As this field also enable for tracking, let's check to Account History.


The value change is not tracked and Last Modified By also stay the same.


Another sample here when user try to send email to invalid email address.


Email Bounce Management will mark the email address as invalid, this will update SystemModstamp, but the LastModifiedDate will stay the same.








Thursday, August 18, 2016

Salesforce Migration Tool using ANT in Windows


Prerequisites

1. Java
Make sure JDK is installed in your computer.
Check it from Control Panel\All Control Panel Items\Programs and Features



** if you do not have JDK installed, download latest JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html

Once installed successfully, check from command prompt:
C:\>java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
Java HotSpot(TM) Client VM (build 25.45-b02, mixed mode, sharing)

** if your JAVA_HOME variable and environment Path have not configured, follow this step:
- Go to Advanced system settings from Control Panel\All Control Panel Items\System, click Environment Variables... button, go to System variables
- New variable JAVA_HOME value C:\Program Files\Java\jdk1.8.0_102 
- Edit Path variable to add value %JAVA_HOME%\bin


2. ANT
Get latest Apache ANT from http://ant.apache.org/bindownload.cgi and select .zip archive file.
Download the file to a folder and extract it.

You need to add this into System variables from Advanced system settings from Control Panel\All Control Panel Items\System, click Environment Variables... button.
- New variable ANT_HOME value C:\SFDC\Ant\apache-ant-1.9.7-bin\apache-ant-1.9.7
- Edit Path variable to add value %ANT_HOME%\bin

Once installed successfully, check from command prompt:
C:\>ant -version
Apache Ant(TM) version 1.9.7 compiled on April 9 2016


3. Force.com Migration Tool
Download Migration Tool from https://developer.salesforce.com/page/Force.com_Migration_Tool, at this moment it will bring me to https://gs0.salesforce.com/dwnld/SfdcAnt/salesforce_ant_37.0.zip, this may change based on Salesforce release. Extract salesforce_ant_37.0.zip to a folder.


Concept

You need to work with 3 files:

1. build.properties
Where? to store variables: username, password, server url
You can find sample of this file from "sample" folder from salesforce_ant_37.0.zip
In this file, you need define: serverurl, username, and password. Sample:
sf.serverurl = https://login.salesforce.com
sf.username = mylogin@gmail.com
sf.password = mypassword8

2. build.xml
How to deploy? retrieve, deploy
This file also available in "sample" folder from salesforce_ant_37.0.zip
In this file, you need to define the target. The concept here is you need to retrieve the metadata from source org., then deploy it to target org.

For retrieve
<target name="retrieve">  
  <!--<mkdir dir="retrieve_folder"/> -->
  <sf:retrieve username="${sf.username}" 
               password="${sf.password}" 
               sessionId="${sf.sessionId}"                 
               serverurl="${sf.serverurl}" 
               maxPoll="${sf.maxPoll}" 
               retrieveTarget="retrieve_folder" 
               unpackaged="package.xml" />
</target>

** mkdir retrieve_folder, this line is just needed if you need the script to create the folder prior retrieval, you can change retrieve_folder to other folder as you want.

For deployment
<target name="deploy"> 
  <sf:deploy username="${sf.username}" 
             password="${sf.password}" 
             sessionId="${sf.sessionId}" 
             serverurl="${sf.serverurl}" 
             maxPoll="${sf.maxPoll}" 
             deployRoot="retrieve_folder" 
             rollbackOnError="true"/>
</target>

** see more parameters here

3. package.xml
What to Deploy?
You can find sample of this file from "sample\codepkg" folder from salesforce_ant_37.0.zip
You need to manually add/update all the components you want to deploy.
Sample:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> 
  <types>        
    <members>Access_Account</members>
    <members>View_All_Data</members>
    <name>PermissionSet</name>
  </types>
  <types>
    <members>Change__c</members>
    <name>CustomObject</name>
  </types> 
  <types>
    <members>Sales Regional</members>
    <name>Profile</name>
  </types> 
  <version>37.0</version>
</Package>

For me personally, I prefer to create a folder and put all 3 files above into that folder for each deployment.

For complete Metadata Components and Types, see https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_objects_intro.htm


Action

This is exciting part where you will start using ANT

To retieve
C:\SFDC\Ant\salesforce_ant_37.0\sample>ant retrieve
Buildfile: C:\SFDC\Ant\salesforce_ant_37.0\sample\build.xml

retrieve:
[sf:retrieve] Request for a retrieve submitted successfully.
[sf:retrieve] Request ID for the current retrieve task: 09S17000001OuaREAS
[sf:retrieve] Waiting for server to finish processing the request...
[sf:retrieve] Request Status: Pending
[sf:retrieve] Request Status: Succeeded
[sf:retrieve] Finished request 09S17000001OuaREAS successfully.

BUILD SUCCESSFUL
Total time: 28 seconds

To deploy
C:\SFDC\Ant\salesforce_ant_37.0\sample>ant deploy
Buildfile: C:\SFDC\Ant\salesforce_ant_37.0\sample\build.xml

deploy:
[sf:deploy] Request for a deploy submitted successfully.
[sf:deploy] Request ID for the current deploy task: 0Af21000002F9xACAS
[sf:deploy] Waiting for server to finish processing the request...
[sf:deploy] Request Status: Pending
[sf:deploy] Request Status: InProgress
[sf:deploy] Request Status: Succeeded
[sf:deploy] *********** DEPLOYMENT SUCCEEDED ***********
[sf:deploy] Finished request 0Af21000002F9xACAS successfully.

BUILD SUCCESSFUL
Total time: 30 seconds



Reference:


Friday, June 24, 2016

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:




Sunday, May 22, 2016

Salesforce: New Event versus New Meeting Request

In previous blog, we discussed about New Meeting Request. However, using Event and Select Invitee, this will also can be used to send invite for coworkers and customers.

What is similar between New Event with select Invitee versus New Meeting Request?
  • Both can be launch from Home page calendar and Open Activities of lead and contact.
  • When you can use customize logo in meeting request, it will be the same logo for both, you can configure from Setup | Customize | Activities | Activities Setting | Show Custom Logo in Meeting Requests
  • Both can invite User, Lead, and Contact
  • Both have start and end date time
  • Both have Location and Subject
  • Invitees will get email of the invite, although the message a little different, Meeting Request have more content, see screenshots below
  • Invitees to response the invite
  • Both event is report-able using standard report type = Events with Invitees

New Event with select Invitee


New Meeting Request


What is the difference between New Event & New Meeting Request?
An event does not necessarily mean that you will be having a meeting with someone, even the event type is meeting, your customer will not receive meeting invite, until you add them as Invitee. When you create new event, scroll down to the bottom and look for Select Invitees section

Once you add invitee to the event, notice the event title change from New Event to New Multi-Person Calendar Event, and there is a button Save & Send Update, this will send email to all invitee. Once New Meeting Request is confirmed, it will have the same behavior as Event with invitee.

New Event 
  • Sender will receive initial email and it consider confirmed invite
  • Meeting times is fixed
  • No customized message 
  • Event send will show in sender Calendar as "Scheduled Meetings"
  • Invitees to accept or decline invite, issue: sender do not get email when invitee response.

New Meeting Request
  • Sender can propose up to five meeting times
  • Sender can customize message
  • When meeting invite sent, event will be show in sender Calendar as "Requested Meetings"
  • Invitees receive email and select preferred meeting times or propose new times
  • After invitee responses, sender to confirm the meeting, sender will get email when invitee response.
  • Invitees will receive email and need to accept or decline confirmed meeting times, here we have the same issue as New Event, sender do not received email as well.
  • When sender confirmed the meeting time, event will move from "Requested Meetings"to "Scheduled Meetings" in Home page

Sample Report
In this scenario, we are using report type "Events with Invitees"
 Sender = Jack Bob
 Invitee 1 = Linda Yie (co-worker)
 Invitee 2 = Sean Lee (lead)

Initial sent
Linda received email
Sean received email

Linda select a time
Nothing change in report

Sean select a time
Nothing change in report

Jack confirm the meeting time
Linda received email
Sean received email

Sean accept & Linda reject the invite


Sender can track who has accept, decline and has not responded to the invite from the event itself.



Reference:


Page-level ad