Monday, June 5, 2017

How to Install the Force.com IDE Plug-In in Eclipse.

Install the Force.com IDE Plug-In

Step 1: Launch Eclipse.

Step 2: Select Help → Install New Software.

Step 3:  Click Add button and write in the Add Repository dialog box,
           Name → Force.com IDE
     Locationhttps://developer.salesforce.com/media/force-ide/eclipse45

→ For Spring ’16 (Force.com IDE v36.0) and earlier Force.com IDE versions, use http://media.developerforce.com/force-ide/eclipse42.

→ Click OK.

→ To install an older version of the plug-in (for example, if you don’t have Java 8), deselect Show only the latest versions of available software.

→ Eclipse downloads the list of available plug-ins and displays them in the Available Software dialog.

Step 4:  Select the Force.com IDE plug-in, and then click Next.

Step 5:  In the Install Details dialog, click Next.

Step 6:  In the Review Licenses dialog, accept the terms and click Finish.

→ In step 4, If you choose to install support for Lightning components, Eclipse displays a warning dialog about installing software that contains unsigned content. We are bundling third-party plug-ins to support Lightning components. Salesforce doesn’t own these third-party plug-ins; hence, we don’t sign them. Click OK to proceed.

→ Eclipse downloads and installs the Force.com IDE and the required dependencies. When the installation is complete, you are prompted to restart. Click Yes.

→ When Eclipse restarts, select Window → Open Perspective → Other. Select Force.com and then click OK.

→ You are now ready to develop and customize Force.com applications in Eclipse!



Sunday, June 4, 2017

Apex - Class


Apex - Class

A class is a template or blueprint from which objects are created. An object is an instance of a class. This is standard definition of Class.

→ 3 ways to create apex class in salesforce
  1.   Apex Class
  2.  Apex from Developer Console
  3.  Force.com Eclipse IDE

    From Apex Class:

     Step 1: Click on Setup option. (Top right side on Org)

     Step 2: Search 'Apex Class' in Quick find box and click on Apex Classes link. It will open the Apex Class details page.

      



     Step 3: Click on 'New' button to create new Class.
          



     Step 4: Write code here and then click on save button.
     


From Developer Console:

    Step 1: Go to Name and click on Developer Console.
    Step 2: Click on File menu New and then click on Apex class.

    Step 3: Write Class name and click on OK button.

    Step 4: Write code here.



   From Force.com IDE:
     Step 1: Open Force.com – Eclipse.

    Step 2: Create a New project by clicking on File New Apex Class.

   
    Step 3: Write the Name of Class and click on Finish button.



    Step 4: Once this is done, the new class will be created.

  
    Syntax:
    private | public | global 
    [virtual | abstract | with sharing | without sharing] 
    class ClassName [implements InterfaceNameList] [extends ClassName] 
    { 
      // Classs Body
    }

    Example:

    public class Sampleclass
    {       
         public static Integer a1 = 0; 
         public static Integer getmultiValue()
        {
                 a1 = a1 * 10;
                 return a1;
        }
    }