12 November 2017

Module - 4 Creating the ContactList Lightning Application With ContactDetails Component & SearchBar Component

Contact List Application 

Step - 1 : Creating ContactListDisplay Apex Class

1. Click File | New | Apex Class

2. Implement the Code as Follows

3. Click Save 

Step - 2 : Creating ContactList Component


  1. In the Developer Console, click File | New |Lightning Component.
  2.  Specify ContactList as the bundle name and click Submit
  3. Implement the component as follows:

Code Highlights

The contacts attribute is defined to hold the list of Contact objects returned from the server.

The init handler is defined to execute some code when the component is initialized. 

That code (doInit) is defined in the component's client-side controller (you'll implement the controller in the next step).


Click File | Save to save the file.

Step - 3 : Creating ContactList.js Controller

1. Click CONTROLLER
2. Implement the Code as Follows
3. Click on Save 

Step - 4 : Creating ContactDetail Component

1. In the Developer Console, click File | New |Lightning Component.
2. Implement the Code as Follows

3. Click on Save

Step - 5 : Creating ContactDetail Controller

1. Click on Controller
2. Implement the Code as Follows

3. Click on Save

Step - 6 : Creating ContactDetail CSS Style

1. Click on STYLE
2. Implement the Code as Follows
3. Click on Save

Step - 7 : Creating SearchKeyChange Event

1. Click on File | New | Lightning Event
2. Enter Name as SearchKeyChange
3. Implement the code as follows



4. Click on Save

Step - 8 : Creating SearchBar Component

1. Click on File | New | Lightning Component
2. Enter Name as SearchBar
3. Implement the Code as Follows

4. Click on Save

Step - 9 : Creating SearchBar Controller

1. Click On Controller
2. Implement the Code as Follows

3. Click on Save

Step - 10 : Creating ContactList Application

In this module, you create the ContactListApplication Lightning Application and we will use Bootstrap to define a basic layout for the application.

What you will learn

  • Create a Lightning Application in the Developer Console
  • Use Static Resources in a Lightning Application
  • Preview your Lightning Application in the browser
Steps


  1. In the Developer Console, click File | New | Lightning Application. Specify ContactListApplication as the bundle name and click Submit
  2. Implement the application as follows:
3. Click on Save and Update Preview to Run the Application.

Module - 3 Creating the ContactController Class

Creating ContactController Class - Salesforce Lightning

  • Salesforce Lightning applications make it easy to work with data.
  • In this module, you create an Apex controller that allows your Lightning application to retrieve contacts, or to Search contacts by name or by id.
What you will learn
  • Create an Apex Controller that exposes data and logic to the client application
Steps:
  1. Open Developer Console, by Clicking your name in the upper right corner screen.
  2. Click on File | New | Apex Class specify ContactController as the class name and click Ok.


Implement the ContactController Class as follows :

public with sharing class ContactController
 {
    @AuraEnabled
    public static List findAll()
    {
        return [ SELECT Id, Name, Phone FROM Contact LIMIT 25];
    }
    @AuraEnabled
    public static List findByName(String searchKey)
    {
        String name ='%'+searchKey+'%';
        return[ SELECT Id, Name, Phone FROM Contact WHERE Name like : name Limit 25];
    }
    @AuraEnabled
    public static Contact findById(String contactId)
    {
        return[SELECT Id, Name, Title, Phone, account.Name FROM Contact where Id=:contactId];
    }
}

ContactController is a regular controller class with methods to retrieve contacts (findAll), or to search contacts by name (findByName) or by id (findById).
The
 @AuraEnabled method annotation makes a method available to Lightning applications

Click File > Save to save the file

How to enables Development Mode in SalesForce.

Development Mode In Salesforce

  • Development mode in salesforce enables developers to embed visualForce page editor in the browser.
  • Enabling Development mode in Salesforce is very essential for developers to build visualforce pages in the view state.
After enabling we can see both code and preview of the visualforce page in the same window.

How to Enable Development mode in Salesforce

Salesforce development mode can be enabled, Navigate to Name | Personal Advanced User.
  • In advance user details, we can edit assignments, can create new group's, Create new Queue, and can access Salesforce Login History details like Login Time, Source IP, Login Type, Login URL, Location.
To Enable salesforce development mode click on Edit button.

Now go to User details section and Enable Development Mode check Box.
Click on Save Button.

How to check Salesforce Development Mode Enabled or Not

To check development mode in salesforce, Navigate to Setup | Build | Visualforce Pages.
  • Now Create a new Visualforce page and Quick save the page.
  • Now click on preview button and the result will be opened in new window.
Click and drag the button. Now visualforce page code and result will be displayed.

What is View State in Salesforce

  • ViewState in salesforce holds the stage of the Visualforce page which includes components, field values and controller state.
  • Salesforce developer environment has a view state inspector, which let user to view the content of the view state.
  • Performance of the page depends efficiently managing the view state.

Salesforce Apex - Introduction To SOQL

SOQL(Salesforce Object Query Language)

What is SOQL(Salesforce Object Query Language) . . . . ?
SOQL means Salesforce Object Query Language.
SOQL Is used to query the records from the database.com based on requirement.
  • Salesforce Apex and SOQL together give the developers powerful tools for managing Salesforce Data and process of their applications.
  • Records are pertaining to single sObject.
  • Using Salesforce Object Query Language developers can fetch and process a large amount of data in an easy, human readable query language.
  • SOQL is very similar to SQL used in other database systems.
  • It doesn't support all advance features of SQL.

SOQL Features

  • Salesforce Object Query Language us a case sensitive and very easy to understand.
  • It is similar to SQL and helps to optimize the code.
  • It reduces workload time.
  • Salesforce Object data can retrieved or extracted to Excel Sheets.
  • It Returns Records
  • Records are stored in a Form of Collections.

SOQL Limitations

  • By default 20000 characters for a Statement.
  • Number of SOQL rows : 50,000
  • Number of SOQL Queries : 20
  • Number of DML Statements : 150
  • Number of DML Rows : 10,000
  • Number of Script  Statements : 200K
  • Number of call out : 10
  • Number of Email Invocation : 10
  • Number of Fields Described : 100
  • Number of Child Relationships : 100
  • Number of Picklist describes : 100
  • Number of Future Calls : 10
  • Maximum Heap Size : 3000K

11 November 2017

Enable Custom Domain For Salesforce Developer Org

Salesforce Custom Domain or Salesforce my Domain must be enabled to use Lightning Components in Salesforce.com.

In This Tutorial, we will learn how to Enable a Custom Domain for a Developer Org, so that we can Use It for Salesforce Lightning.

Custom Domain URL will be like https://MyDomain.my.salesforce.com

In Place of MyDomain, you can Include your own Name or Any Name you wish to include.

To Create Custom Domain Follow Below Steps :

1. Click on Setup
2. In the Quick Find Box, Enter My Domain.
3. Click on My Domain.
[or] 
1. You can Directly Navigate to Administer | Domain Management | My Domain.
Select My Domain
2. Enter the Name of your SubDomain after https:// and Check Availability.
Typically, a subdomain is your name of a company, or you can include your own name as long as it's Unique.
If the Name was already taken, choose another name.
3. Click Register Domain.

Benefits of Custom Domain :

1. We can create our own custom URL .
2. We can set custom Login Policies.
3. Using Custom Domain, Salesforce user can login through Facebook and Google Account.

Module - 2 Setting Up Your Environment

Lightning Environment

In this module, you set up your environment to enable Lightning development.
What you will learn
  • Create a Namespace 
  • Enable Lightning Components in your Salesforce Environment / Org 
  • Upload Static Resources for use in your Lightning application 

Step 1: Create a Namespace

A namespace is globally unique across all Salesforce organizations. Namespaces are case-insensitive and have a maximum length of 15 alphanumerical characters.
1. Login to your Salesforce Developer Edition
2. Click Setup 
3. In the Quick find box Search for Packages, Click Create > Packages 
4. Click Edit and Continue 


5. Enter the namespace prefix you want to register, and click Check Availability. If the namespace you entered is not available, try again until you find a namespace that is available.
6. Click Review My Selections
7. Click Save

Step 2: Enable Lightning Components

1. Click on Setup
2. Click Develop > Lightning Components 
3. Check the Enable Lightning Components checkbox 
4. Click Save

Step 3: Upload Bootstrap as a Static Resource

To help you make the application look good, you will use a version of Twitter Bootstrap customized to match the Salesforce1 guideline.
1. Download and unzip the Salesforce Foundation Bootstrap

https://github.com/SalesforceFoundation/bootstrap-sf1
To download click on Download button, or to view on Github click on Github Button Link.
OR
http://developer.salesforce.org/bootstrap-sf1/
2. In Salesforce, click on Setup
3. Click on Build > Develop > Static Resources


4. Click New
5. Specify BootStrap as the Name, then click the Choose File button, and select the bootstrap.css in the dist/css directory of the unzipped bootstrap folder




6. Click Save

Module - 1 Creating SFDC Dev Org Environment

SFDC provides free developer edition environment, where you can create or develop force.com applications for free.

In Addition, SFDC Provides many editions as per the customer requirements. Each edition has its own features.

Following are the Paid Editions
Contact Manager
Group

Professional
This edition is designed for businesses who need full-featured CRM functionality. Professional Edition includes straightforward and easy-to-use customization, integration, and administration tools to facilitate any small to midsize deployment.

Enterprise
This edition is designed to meet the needs of large and complex businesses. Enterprise Edition orgs get advanced customization and administration tools, in addition to all the functionality available in Professional Edition, that can support large-scale deployments. Enterprise Edition also includes access to the web services API, so you can easily integrate with back-office systems.

Unlimited

This edition is Salesforce’s solution for maximizing your success and extending that success across the entire enterprise through the Force.com platform. Unlimited Edition customers benefit from new levels of platform flexibility for managing and sharing all their information on demand. Unlimited Edition includes all Enterprise Edition functionality plus Premier Support, full mobile access, unlimited custom apps, increased storage limits, and more.

Developer
This edition provides access to the Force.com platform and API. A Developer Edition org allows developers to extend the Salesforce system, integrate with other applications, and develop new tools and applications. Developer Edition provides access to many of the features available in Enterprise Edition orgs.

In developer edition we can have access to Apex, Visualforce, Force.com Integration API’s, Force.com sites, Database and much more. . . .

Licences available in developer edition
  •  2 Salesforce CRM Licences
  •  2 Salesforce mobile Licences
  •  3 Salesforce Platform Licences
  •  5 Salesforce Partner Licences
  •  10 Salesforce customer portal Licences.
Developer Edition Limits

 5 MB – Data Storage
 20 MB – File Storage

To Create Developer Org / Environment, You Need to follow below mentioned Steps

Step 1

Open https://developer.salesforce.com/
Click on Sign Up button, on clicking Sign up , it will navigate to Registration Page.

Step 2

Enter Details required to create developer Org, Make sure that Username should be in the format of e-mail (Example: dev-account-name@salesforce.com or user can choose any domain).

After entering all the details click on Sign me up.

Step 3

You will receive an Email, To Activate your account click on Verify.
On verifying developer account, you will be Navigate to Set Password Page for your Account.
Enter your new password information, and click Save
For more Information, you can visit https://developer.force.com/
You can login in to your Dev Org, you can visit https://login.salesforce.com/
Enter User Name & Password to login into your Dev Org & you can enable 2-step verification using your mobile no.