Friday 26 August 2016

Live Agent Implementation | Setting up live Agent in Salesforce


What is Live Agent

Now days customers expect fast replies and quick resolutions. With Live Agent web chat, We can give them quicker responses to their queries. Live Agent provide users the ability to interact with the agents through web chat to get more information about specific product or queries

Process 1) Follow below Step to Setup Live Agent 

Step 1 :- Open live Agent Setting
Customize --> Live Agent----> Live Agent Setting



Step 2:- Enable Live Agent 
Click on Enable Live Agent Chat Box and click on save button



Once you will enable the Live Agent below object will auto created in your org.
  1. Live Chat Visitors
  2. Live Chat Transcripts
  3. Live Chat Transcript Events
  4. Live Agent Sessions
  5. Live Agent Supervisor
  6. Live Agent
  7. Quick Text
Step 3:- Setup Live Agent User.

Setup--> My Setting -> Advanced User Details--> Then click on Live Agent User checkbox



Step 4:- Set Skill

Click on Setup --> Live Agent --> Skill



 Then Click on new button and setup skill like below screen



Step 5:- Upload Online and Offline Image

Upload online and offline image in "Static Resource"



Step 6:- Setup Chat Buttons & Invitations

Setup--> Customize -->Live Agent --> Chat Button & Invitation.


then click on New Button. And add all below detail


Once you will click on Save button the chat button code will come

Copy Above Script and keep with you

Step 7:- Create Deployment

Click on Setup-> Customize --> Live Agent--> Deployments


Then click on New button and provide all below detail


Then click on Save button. After Saving Deployment code will come like below


Copy the Deployment code.

Create the HTML page with Chat Button Code (Step 6) and Deployment Code.


NOTE:- First you need to copy Chat Button Code then Deployment Code.

Now you all Set with live Agent Configuration

Process 2) Now Setup the Agent Console ( Console App )


Step 1:- Open App Wizard
Setup--> Create --> App



Step 2:- Create new Console App

Click on new button then select console button


While creating the App on Step 6 select the "Include Live Agent in this App" check box like below




Now All Set. We can test the same now


Process 3) How To Test

Click on HTML page which you created in process 1 Step 7.

Once you page will open and Agent is not online the below Html page will show you offline image


Once Agent will come online from agent console then image will change on client HTML page

How Agent will come online

Step 1:- Select Live Agent Console App


Step 2) Then from the Live Agent Click on Online button



Now All Set Agent is online :)

Step 3) Refresh you HTML page
Once Agent will login the HTML will show you online image like below


Then click on Image the set session will start.



Accept chat from agent console




Thanks,
Amit Chaudhary



Monday 22 August 2016

Enter Search | Enter Key to Execute Method in salesforce


Problem :-
Call Apex method on click of Enter button

Solution :-
We can use the "keyCode==13" with actionfuction to call the apex method on Enter Key event like below

Apex Class

public with sharing class EnterSearchController {

    public string strKey {get;set;}
    public List<Account> lstAccount {get;set;}
    public EnterSearchController()
    {
        lstAccount = new List<Account>();
    }

    public pageReference cancel()
    {
        return new pageReference('/001/o');
    }
    
    public void search()
    {
        if( strKey != null && strKey !=''  )
        {
            String wildcard = '%'+strKey+'%';
            lstAccount = [select id,name from account where name like :wildcard  ] ;
        }
        
    }

}

VF page

<apex:page controller="EnterSearchController" >
    <apex:form >
        <apex:pageBlock >
        <apex:actionFunction action="{!search}" name="actionFunction" /> 
        
            <apex:pageBlockSection >
                <apex:inputText value="{!strKey}" onkeydown="if(event.keyCode==13){this.blur();actionFunction();}" />
                
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
                <apex:commandButton action="{!cancel}" value="cancel" />                
                <apex:commandButton action="{!search}" value="Search" />                
            
            </apex:pageBlockButtons>
            
            <apex:pageBlockSection columns="1" >
                <apex:pageBlockTable value="{!lstAccount }" var="acc">
                    <apex:column value="{!acc.name}"/>
                    
                </apex:pageBlockTable>
            </apex:pageBlockSection>
            
        </apex:pageBlock>
    </apex:form>
</apex:page>



Other Related Link
1) http://developer.force.com/cookbook/recipe/submit-a-form-with-the-enter-key

Monday 15 August 2016

CLI | command line interface salesforce |


Requirements for the batch process

1) Data Loader
2) JRE

Step 1) Encrypting Passwords

1: Create the Key File



Execute above command and copy the Key and paste in notepad and save as SFDC.key .


2: Create the password



Then with the help of key file create the password and save same password in config.property file.

Step 2) Create the process-conf.xml 

The process-conf.xml file contains the setup for each action that needs to take place. Each Extract, Insert, Upsert, or Delete function needs to have a different section in the process-conf.xml file.




Step 3) Configuration properties (config.properties )

The process-conf.xml file mostly contains properties for more then one Process Beans. So we can use the config.properties file for all common properties like below
1) User Name
2) Password



Step 4) How  To Run Process 





Thanks