Tuesday, 19 May 2015

Salesforce Object Search Language


When you want to find records for more than one Object based on search string that you specify is called SOSL.

We are passing the entire SOSL expression in “StringsearchExpr” parameter of the search() call.

SOSL does not search the following object and fields

  1. Any elements such as picklist that are defined as not searchable()
  2. Number,date or checkbox fields. (Use SOQL to search this fields)
  3. Textarea fields, unless you use the ALL FIELDS in search group.
  4. Attachment records associated with Account, contact or opportunity.

Example Query 

 

In Apex:

FIND ‘keyword*’ IN ALL FIELDS RETURNING Account (Id, Name), Contact, Opportunity, Lead

In Force.com API

FIND {keyword*} IN ALL FIELDS RETURNING Account (Id, Name), Contact, Opportunity, Lead
 
Find Keyword
  • You can search a single word or a phrase.
  • You can use “ ”,AND,OR,AND NOT,().
  • Reserved Character:
? & | ! { } [ ] ( ) ^ ~ * : \ " ' + -  
            If we are using the above characters, then we should use backslash \ character (escape sequence).

IN Search group: 

 

This is optional clause, which allows you to define the type of fields to search.
ALL FIELDS
EMAIL FIELDS
NAME FIELDS
PHONE FIELDS
SIDEBAR FIELDS


Returning:


Syntax:
Returning ObjectTypeName [(Fieldlist [where ConditionExpression] [order BY Clause] [LIMIT n])][ ,ObjectTypeName[(FieldList) [where ConditionExpression] [Order BY clause] [Limit n])] ]

Object Type Name
Object to return.
Field List
Optional One or more field from the object
Where Condition
Optional, Specify the filter for the particular object
Order By Clause
Optional, Arrange the given values in asc and desc for the specified object.
Limit n
Optional, Number of rows the query should return for the specified object.

With Division :


The division should be enabled for the organization, in order to use this syntax. It will act similar to where condition. But if we use division keyword, below are the advantages.

  • It pre-filters all records based on division before applying other filters.
  • You can specify the division’s name in the filter, rather than its ID( as is required if you filter on division in the WHERE clause)

To Label:


Syntax:

toLabel(Object.field)

FIND ‘string*’ RETURNING Account(Name, toLabel(Recordtype.Name))

This query returns Account records with the record type name translated into the language for the user who issued the query.

We cannot filter on the translated name value of the record type. Always filter on the master values or the ID of the object for record types.

Friday, 17 April 2015

Remove From Address on "Send an Email" Page

Sometimes we can able to see 2 same email address in Send an email Page. Like below image.

"From" list will show all the emails from

            1. Email to Case
            2. Organization-Wide Addresses.

If you don't want to display the emails in "From" list, then we have to remove the address from Organization-Wide Addresses.

Setup -> administer -> Email Administration -> Organization-Wide Addresses. 

Remove the address from here.

This will help us to maintain the "From" list in a clean way.

Monday, 13 April 2015

How to setup Live Agent


For setting up live agent, we need to have license for live agent. In Developer Edition, we have 2 licenses.

Step 1 :

 

We need to enable the Live Agent.



Now, we can able to see the below list of setting in salesforce.




Step 2: Skills

 

Skills are used to track agent’s areas of expertise and to make sure that chats are routed to agents with the required skills. 


We need to give the name and we have to select the User, who has the correct skills and select the User and also we can select the profile. If we want to include some user of the particular Profile then we can use "Select User" option and if we want to use the profile that all the user going to use live agent then we can go profiles. Click Save button.

Step 3: Chat Buttons and Automated Invitations

 

we are going to configure the chat button and automated invitations, how customer can interact with the Live agent.



we can configure the behavior of the live chat notification and how the request should reach the Agent.



Second part is the site configuration, it is not necessary unless you need to have a pre-chat form or we need to setup the live chat button in Force.com sites. We can take a look when we have to configure the pre-chat form. Click on save.

Once Chat button is saved, you can see the HTML code of the button.

Step 4 :  Live Agent Configuration

 

Here we have 5 sections. First we can see about "Basic Configuration". 



Next section is like Assign User and Assign Profiles.



So if you want the particular profile needs to be selected (means all the user under the profile going to use Live agent) else we can select individual user.

Next section is Supervisor Section




In this section, we are going to configure the supervisor for the Agent. So supervisor can send private message to Agent while they are in chat and also they can see what the Agent is typing with the customer.

The Last section is Chat Transfer.



So In this section we can transfer the chat to another Agent. This will help the Agents, if they are not able to answer for the particular queries.

Step 5: Live Agent Deployment



Once it is saved. It contains some HTML code. 

Step 6:

 

Copy the HTML code from Deployment and also from chat button setting. create one Html Page and put the script into the HTML Page.


 

Step 7: 

 

Enable the Live Agent License into the User.



To Make the Live Agent visible to the Agents, we have to setup Service Cloud console. For that you can see this link.

http://priyamohanraj.blogspot.in/2015/04/setup-service-cloud-console.html