Monday, 28 May 2018

Snap-Ins Chat Set Up - Service Cloud


What is Snap-Ins Chat ?

This is a new feature Salesforce introduced as part of Service Cloud in order to serve the customer better.
Snap-ins Chat uses Live Agent, but with a simpler setup, to power your chats

Note: 
1.This feature available only in lightning
2. Snap-Ins chat uses Live Agent,But with a simple set up,to power your chats.
3. Add the chat code to the web pages where you want the chat snap-in to be available.

Snap-Ins advantage over Live Agent?

I consider Snap-Ins is like "Live Agent Plus",
1. Use Snap-In to maintain user sessions in multiple tabs ,Which is not possible through Live Agent.
2. Snap-In chat setting up is simpler & It is lightweight to use in Mobile or other device.

Steps to Set Up  Snap-Ins Chat:

1.Enable Live Agent

2.Create/Update User with Live Agent checkbox checked

3.Enable Omni Channel

4.Add Omni Channel Presence Statuses

5.Enable Lightning
6.Create Omni Channel Routing Configuration

7.Create Queue to route the chat request

8.Create Chat button & Configure Routing Information

9.Create Live Agent Deployment

10.Create Omni SnapInDN  & Configure Chat Button & Deployment details


11. Omni Deployment SnapInDN - Code Snippet

12. Create Visualforce Page & Add Chat button code and Snap-Ins code snippet


13. Create Force.com Site & Add this Visualforce Page

14. Execute the Site & See the Live Agent Chat Window

15. Verify the chat request in Service Console - Case - Omni Channel


Wednesday, 11 April 2018

2 Factor Authentication / 2FA

Single Factor Authentication  VS 2 Factor Authentication(2FA)?


Single Factor Authentication
2 Factor Authentication
Only one level, Usually password used for authentication
2 level of authentication, Usually Password + Any verification code from hard ware device typically mobile

Ex: 
1. OTP
2. RSA hardware device


Why do we need 2 Factor Authentication(2FA) ?

This provides additional layer of security.
Ex:
  • OTP (One Time Password)
  • Finger Prints
  • Facial Recognition
  • SMS 
  • etc..


Any live examples have you come across?

Yes,
1. Every time any bank transaction it will ask for OTP which used to get in my registered mobile
2. Every time you try Salesforce login in new browser  it will send OTP to your registered Mobile/ Email


Authentication Apps Vs Text/Voice/Email ?

Authentication apps prompts 6 digit number every 30 seconds once.So no need to wait to recieve any text/voice/Email message.
Only the thing is need to install Authenticator the app.


What are the different Authenticator apps you know?

  • Google Authenticator
  • Salesforce Authenticator


How to enable 2 Factor Authentication in Salesforce?




Friday, 6 April 2018

API Testing Tools & Salesforce API Test

What are the API Testing Tools ?

Few tools available to test the REST / SOAP API with out writing any code.
With that simple test  can verify web service is working fine or not.

Share the widely used API Tools information?

Below are the tools which i used in my experience.
  • Hurl
  • Postman
  • SoapUI

Explain each one ?

SoapUI
PostMan
Hurl.it
Specifically built tool for API functional testing.
Google Chrome Extension for API testing.
Online link available foe API testing.

Download SoapUI Open Source

Google Chrome Webstore – Add this extension
Sign in using below
Note: If we have account, Can login to any machine and get all the API collections which we tested.

Supports both REST & SOAP
Supports both REST & SOAP, But mostly used for REST API testing
Only REST API testing supported.
Time Saving – The raised request can be save and can re-run later point of time.
Time Saving – The raised request can be save and can re-run later point of time.
Time Consuming – Every time need to enter the request details.
Installation needed
Extension need to be added
Not required any installation, Directly access by url

How to access Salesforce API from external application?

  1. Create a Connected app in Salesforce. Share Consumer Key,Consumer Secret with client.
  2. Create a user with access API only access.As best practice create a separate profile API access and create a user under that.Share that user credentials with external application. 
    • Note: This user credentials will be shared with external application,So it should have permission only 'API Only User' to limit that credential access.
  3. Generate Access Token from these values & Send CRUD request along with Access Token.



How to generate access token from "Hurl" tool ?

Please enter below details to get the access token

POST
https://salesforce.com/services/oauth2/token
Authentication
Basic Authentication, Add Username & Password
deepik@gmail.com
pwd
Headers

Content-type
application/x-www-form-urlencoded
Parameters :
username
deepik@gmail.com
password
pwd
client_id
3MVG9d8..z..iQcL79m2_ABa8Kiq5mtRIW88bMQS5JVc6_4_zdyIjDZ8
client_secret
127141494000000000000
grant_type
password





Some times you get Invalid_grant / Authentication Failure error? What could be the reason?

           1. If your organization security token is enabled,Need to add password+security token in above password field
        2. If IP range is enabled and still getting the above error,Please verify on connected app permission is granted or not.Provide the permission for that user.

How to get the user details from Salesforce by passing the user id from external application?



GET
https://salesforce.com/services/apexrest/User/
Headers

Content-Type
application/x-www-form-urlencoded
Authorization
Bearer  00D7F000000owBh!AQwAQJ9d5Ffx9ndeM8
1DPowo8AM1kOe88Y
TnSw0tJUTUgDxtov64NaO_8kxCFQ0
Parameters

UserID
0057F000d4000

What is the significance of "Bearer" in Authorization request?


            Authentication Type.

How to perform API call with out code?Ex:Get the user details from Salesforce?






How to generate Access token & API request from Postman ?




Monday, 12 March 2018

Lightning Shorthand

  1. What is Salesforce lightning component framework?
The Lightning Component framework is a UI framework for developing dynamic web apps for mobile and desktop devices.

     2.  What are the different component framework ?          

     3.  Why Component Framework is future?

         Re-Usability
         Responsiveness
         Event - Driven Approach
         Highly extensible & Customizable
         Highly interactive and immersive experiences possible with lightning

    4. Visualforce Components already available for reusability so why do 
        we need   lightning  components?
        Lightning Component framework enforces developers to break application into                      components.Where as VF does not.
        Visualforce components are page-centric and most of the work is done on the                        serverLightning is designed from the component up, rather than having the concept            of a  page as its fundamental unit.Lightning Components are client-side centric,  
        which makes  them more dynamic and mobile-friendly      

    5.  Lightning VS Visualforce ?

Lightning Component Framework
Visualforce
App Centric
Page Centric
Lightning, on the other hand, is a modern UI framework used in the development of dynamic web apps for desktop and mobile devices.
Visualforce enables developers to build custom user interfaces with a native hosting on the Force.com platform
It is responsive,
If you are developing for a Salesforce1 mobile app, you should prefer Lightning framework
If you want to create a page-centric experience with limited client-side logic, you must opt Visualforce framework.
UI Generation : Client-Side(Javascript)
UI Generation : Server-Side
Organizations that can’t use Apex code can’t use Lightning Components
Organizations that can’t use Apex code Still they can use Visualforce.
These applications are generally referred to as single-page applications, or SPAs, and are often built using third-party frameworks like AngularJS or React.
Visualforce provides the facility for delivering template-driven web pages and email messages

6. Single Page Application?


7. Lightning component architecture?


8. What is Aura in Salesforce Lightning?
Aura is the open source technology that powers Lightning Components. The aura: namespace contains all of the basic building blocks for defining components and applications.
 <aura:attribute/>
<aura:iteration/>

9. What is the use of annotation ‘@AuraEnabled’ ?
    Only the methods/properties enabled with this annotation are accessible in lightning.

   @AuraEnabled
    public static List<Contact> GetContactList()
    {
            List<Contact> contList = [Select Id,FirstName,Email From Contact];
            return contList ;
    }

10. Explain the Lightning Component Configuration ?

Type
Interface Reference
Details
Lightning Tab
force:appHostable
Interface indicates the component can be

1.Hosted in the Salesforce1 Mobile app

2.Component available as a custom tab.
Lightning Page
flexipage:availableForAllPageTypes
A global interface that makes a component available in the Lightning App Builder, and for any type of Lightning page.

Lightning Record Page
flexipage:availableForRecordHome
If your component is designed only for record pages, implement the flexipage:availableForRecordHome interface instead of flexipage:availableForAllPageTypes




Lightning Record Page
force:hasRecordId
 Interface indicates the current record Id should be injected in the component’s recordId attribute

<aura:attribute name="recordId" type="Id" />
Lightning Communities Page
forceCommunity:availableForAllPageTypes
To appear in the Community Builder, a component must implement this interface
Lightning Quick Action
force:lightningQuickAction
Interface to a Lightning component to enable it to be used as a custom action in Lightning Experience or the Salesforce mobile app.

11. What is lightning component bundle ?

A bundle is sort of like a folder. It groups the related resources for a single component

Resource
Details
Component
Contains markup for the component or app
Controller
Contains client-side controller methods to handle events in the component.
Helper
JavaScript functions that can be called from any JavaScript code in a component’s bundle
Style
Contains styles for the component.
Documentation
Provide Component Documentation
Renderer
Client-side renderer to override default rendering for a component.
Design
Design attribute is a configuration for admin.
Anything wanted to expose to admin to enter that attribute can be made as design attribute.
SVG
Custom icon resource for components used in the Lightning App Builder or Community Builder.

12. What is attribute in lightning component?
It’s like variable declaration in Apex,Here we can store data received from Apex to the lightning attributes.
<aura:attribute name="listAccount" type="Account[]"/>
<aura:attribute name="Name" type="String]"/>

13. What is “v” , “c”,”$A”  in lightning coding?
       

Name   
Details 
Example
v
v refers to view
var strClaimStatus = component.get("v.Name");
c
c refers to controller.
var getContDistribution  = component.get("c.GetDocAndFormList");  
$A
Its top level namespace for creation of components, getting a component, setting a component, Enqueuing Action, Running an Action
 $A.enqueueAction(getContDistribution);

14. How to debug the lightning component ?
      console.log(JSON.stringify(response.getReturnValue()));

15. How to test the lightning components ?
 After you create a component, you will want to display it somewhere. There are a number of possibilities.
Standalone Lightning app: Create a standalone Lightning app (e.g. myapp.app) and include your component in this app. Access your Lightning app by URL.

Lightning Experience: Display your component in the Lightning Experience using the App Builder. You can edit the home page, edit a record detail page or create/edit a new app page to include it. Alternatively, you can create a custom Lightning tab that references your component and add that tab to your Lightning navigation.

Salesforce1 Mobile app: Display your component in the Salesforce1 Mobile app by creating a custom Lightning tab that references it and adding that tab in your mobile navigation.

Template-based community: Display your component in your template-based (e.g. Napili) community using the Community Builder.