Thursday 23 April 2015

What is Lightning Component in Salesforce? How to enable Lightning Component in Salesforce?

       The Lightning Component framework is a UI framework for developing dynamic web apps for mobile and desktop devices. It’s a modern framework for building single-page applications engineered for growth.

Learn about AURA framework from the below video,

                                        

          The Fastest and trending world moves their business process in various devices such as laptop, phones, tablets, etc. Device compatibility is one of the major concerns of the application development. Salesforce comes up with Lightning tools to build responsive and device compatibility application. The following tools are available for developers,

1. Lightning Components give the Client (JavaScript) – Server (Apex) framework and Multi-tier architecture. It’s ideal for use with the Salesforce 1 mobile app.

2. Lightning App Builder used to build apps visually without code

Advantages of Lightning Components

The Lightning Component framework is built on the open-source Aura framework. As per salesforce documentation the following advantages that helps you to build more sophisticated and device computability applications.

1. You don't have to spend your time optimizing your apps for different devices as the

2. Uses an event-driven architecture for better decoupling between components.

3. Faster development with improved performance.

4. Apps use responsive design and provide an enjoyable user experience. The Lightning components take care of that for you.

Component framework supports the latest in browser technology such as HTML5, CSS3, and touch events.

Steps to Enabling Lightning Components

Before starting to build the lighting application, you must need to enable this feature in your organization by the following steps,

Setup --> Build --> Develop --> Lightning Components --> Enable Lightning Components (Checkbox) --> Save

You can also Enable debug mode option to make it easier to debug JavaScript code in your Lightning components.

Note: You can’t use Force.com canvas app in salesforce1 if you enable lighting components.


Book Reference: Lightning Developer Guide

Component Reference:

 https://<mySalesforceInstance>.lightning.force.com/auradocs/reference.app, where <mySalesforceInstance> is the name of the instance hosting your org; for example, na1.

Thursday 9 April 2015

Faster and Efficient Salesforce Deployment Steps Using the ANT Migration Tool

Salesforce Deployment ???  : )

       Most of you know, there are various deployment tools available such as Change Set, Force.com IDE or Eclipse and ANT Migration Tool. This tutorial will be helpful to know how to use and deploy code in salesforce using ANT Migration tool.

Force.com Migration Tool

      The Force.com Migration Tool is a Java/Ant-based command-line utility, based on the Force.com Metadata API, for moving metadata between a local system directory and a Force.com organization.It's simple, faster and efficient deployment tool.  You can also learn more about ANT tool usage on Force.com Migration Tool Guide

ANT Environment Setup

        Please take care of the below installation steps. Skip the below steps if you already configured JAVA and ANT.

       1. Java 
               Download Java
               Setup Path

       2. ANT Tool
               Download ANT
               Installation Instructions

ANT Deployment Folder Structure

      1. Create a folder on any of your hard disk partition. For example, i have created folder called "Build" in "D:" colon. 
      2. Download this XML file Download Link
      3. After download, Paste the download XML file into the Folder that you created. For me i pasted this file into Build Folder.
    
Creation of Outbound Change Set
 
Change Set available only on Sandbox Org. 

    1. From Setup, click Deploy | Outbound Change Sets.
    2. Click the name of a change set.
    3. Select the organization you want to send the change set to.
    4. You don't need to upload it.


Consider i have created change set named DeploymentChangeSet

      1. Go to the Folder Build, then Edit the build.xml file in your editor app. Such as Notepad++, notepad, etc. My preference go with Notepad++.

      2. In Line No: 8, you will find the below code


  1.     <property name="create.folder" value="Your Folder Name" />

Enter the Folder name in the place of value.

    3. In Line No: 11, you will find the below code,


  1.     <property name="my.pkgName" value="Your Change Set Name" />

Enter the Change Set name in the place of value attribute. For me, i created change set called DeploymentChangeSet


    4. From Line No 17 to 20, you will find the below code,


  1.     <target name="retrieveCode">
  2.         <mkdir dir="${create.folder}"/>
  3.         <sf:retrieve username="Source Org Username" password="Password With Security Token" serverurl="https://test.salesforce.com"retrieveTarget="${create.folder}"packageNames="${my.pkgName}"/>
  4.     </target>

Enter the source org username in the place of username attribute, the give the source org password with security in the place of password attribute. serverUrl refers the your org url, for me source org is sandbox, hence the URL will be test.

   5. From Line No 23 - 26, you will find the below code,


  1.     <target name="deployCode">
  2.         <sf:deploy username="Target Org Username" password="Password With Security Token" serverurl="https://test.salesforce.com"deployRoot="Your Folder Name" >
  3.         </sf:deploy>
  4.     </target>

Enter the target org username in the place of username attribute, the give the target org password with security token in the place of password attribute. serverUrl refers the your org url, for me target org is sandbox, hence the URL will be test. change this according to your org.

   6. Save the build.xml. If overwrite/replace option asked means, then please do that.

ANT Deployment Steps

  1. Run the Command Prompt.

  2. Go the your folder name, for example i have created folder in D: and folder name is Build.

  3. Type ANT -verbose retrieveCode





  4. Your components will be retrieve from the change set and it will be stored in the Build directory.

  5.  Type ANT -verbose deployCode




For Developer edition, you cannot create ChangeSet. So you can just take a backup from eclipse. Then Paste the deployment components in the folder structure, such as classes, objects, etc. In this scenario, you can just mention the target org in build.xml and and directly you can deploy it to any org.

You will see the deployment status in CMD, also you can check it in Deployment Process under Setup up in the target org.

That's it...!

Comment your doubts if you are not clear...!

Activities: Assign Tasks to a Queue Salesforce Lightning

Salesforce announced to assign Tasks to a Queue beginning from Spring'20 release. How does it work? In Setup, enter Queues in th...