Difference between extends and implements keywords

extends is for extending a class. 

implements is for implementing an interface.

extends is for when you're inheriting from a base class (i.e. extending its functionality). 

implements is for when you're implementing an interface.

A class can only "implement" an interface. A class only "extends" a class. Likewise, an interface can extend another interface. A class can only extend one other class. A class can implement several interfaces.

lightning:map - Showing multiple markers in Map in Salesforce Lightning Component?

Sample Code:

Lightning Component:


  1. <aura:component implements="force:appHostable" controller="AccountListController" >  
  2.       
  3.     <aura:attribute name="markers" type="Object[]"/>  
  4.     <aura:attribute type="Account[]" name="acctList"/>  
  5.     <aura:attribute name="mycolumns" type="List"/>  
  6.       
  7.     <aura:handler name="init" value="{! this }" action="{! c.fetchAddr }"/>  
  8.       
  9.     <div class="slds-grid slds-grid_vertical">  
  10.           
  11.         <div class="slds-col">  
  12.               
  13.             <lightning:datatable data="{! v.acctList }"   
  14.                                  columns="{! v.mycolumns }"   
  15.                                  keyField="id"  
  16.                                  hideCheckboxColumn="true"/>  
  17.               
  18.         </div>  
  19.           
  20.         <div class="slds-col">  
  21.              
  22.             <lightning:map mapMarkers="{! v.markers }"/>  
  23.               
  24.         </div>  
  25.           
  26.     </div>  
  27.                      
  28. </aura:component>  

Lightning Component Controller:


  1. ({  
  2.       
  3.     fetchAddr : function(component, event, helper) {  
  4.           
  5.         component.set('v.mycolumns', [  
  6.             {label: 'Account Name', fieldName: 'Name', type: 'text'},  
  7.             {label: 'Billing State', fieldName: 'BillingState', type: 'text'},  
  8.             {label: 'Billing City', fieldName: 'BillingCity', type: 'Text'}  
  9.         ]);  
  10.           
  11.         var action = component.get("c.fetchAddresses");  
  12.         action.setCallback(this, function(response) {  
  13.               
  14.             var state = response.getState();  
  15.             if ( state === "SUCCESS" ) {  
  16.                   
  17.                 component.set( "v.acctList", response.getReturnValue().listAcct );  
  18.                 component.set( "v.markers", response.getReturnValue().listAddrWrap );  
  19.                   
  20.             }  
  21.               
  22.         });  
  23.         $A.enqueueAction( action );  
  24.           
  25.     }  
  26.       
  27. })  

Apex Class:


  1. public class AccountListController {  
  2.       
  3.     @AuraEnabled  
  4.     public static Wrapper fetchAddresses() {  
  5.           
  6.         List < CompleteAddressWrapper > listAddrWrap = new List < CompleteAddressWrapper >();  
  7.         List < Account > listAcct = new List < Account >();  
  8.         Wrapper wrap = new Wrapper();  
  9.            
  10.         for ( Account acc: [ SELECT Id, Name, BillingStreet, BillingState, BillingCountry, BillingPostalCode,  
  11.                                     BillingCity, BillingLatitude, BillingLongitude  
  12.                                FROM Account   
  13.                               WHERE BillingStreet != null   
  14.                               LIMIT 100 ] ) {  
  15.               
  16.             AddressWrapper addrWrap = new AddressWrapper();       
  17.             CompleteAddressWrapper objWrap = new CompleteAddressWrapper();  
  18.             addrWrap.Street = acc.BillingStreet;  
  19.             addrWrap.City = acc.BillingCity;  
  20.             addrWrap.State = acc.BillingState;  
  21.             addrWrap.Country = acc.BillingCountry;  
  22.             addrWrap.PostalCode = acc.BillingPostalCode;  
  23.             objWrap.location = addrWrap;  
  24.             objWrap.icon = 'custom:custom32';  
  25.             objWrap.title = acc.Name;  
  26.             listAddrWrap.add(objWrap);  
  27.             listAcct.add(acc);  
  28.               
  29.         }   
  30.           
  31.         wrap.listAcct = listAcct;  
  32.         wrap.listAddrWrap = listAddrWrap;  
  33.         system.debug('Out ' + listAddrWrap);  
  34.         return wrap;  
  35.           
  36.     }  
  37.       
  38.     public class Wrapper {  
  39.           
  40.         @AuraEnabled  
  41.         public List < Account > listAcct;  
  42.         @AuraEnabled  
  43.         public List < CompleteAddressWrapper > listAddrWrap;  
  44.           
  45.     }  
  46.       
  47.     public class AddressWrapper {  
  48.       
  49.         @AuraEnabled   
  50.         public String Street;  
  51.         @AuraEnabled   
  52.         public String City;  
  53.         @AuraEnabled   
  54.         public String State;  
  55.         @AuraEnabled   
  56.         public String Country;  
  57.         @AuraEnabled   
  58.         public String PostalCode;  
  59.           
  60.     }  
  61.       
  62.     public class CompleteAddressWrapper {  
  63.           
  64.         @AuraEnabled   
  65.         public String title;  
  66.         @AuraEnabled   
  67.         public String icon;  
  68.         @AuraEnabled   
  69.         public AddressWrapper location;  
  70.           
  71.     }  
  72.       
  73. }  

Output:



How to deploy Field Level Permissions with profiles using Change Set in Salesforce?

1. Add the fields in the Change Set Components section.

2. Add the Profiles in Profile Settings For Included Components section.


How to set up Salesforce Data Loader Command Line Interface or CLI?

1. Navigate to Setup –> Data –> Data Loader.


2. Download the data loader.

3. Install it following the wizard.

Note:
Make sure Command Line Tools and Samples option are selected in the wizard.


4. Make sure JAVA is installed in your machine by running "java -version" command on your Command Prompt Window.


5. Navigate to Program Files --> Data Loader --> bin in command prompt and run encrypt.bat –k. It will generate dataLoader.key file.


6. Run encrypt.bat -e YOURORGPASSWORD "KeyFileLocation\.dataloader\dataLoader.key" to get the password in encrypted form.


7. Create DataLoaderFiles folder or create a folder with your name choice outside Program Files folder. In my case I have created in C drive. Path is C:\DataLoaderFiles.

8. Navigate to C:\Program Files (x86)\salesforce.com\Data Loader\samples\conf to get some sample sdl files. Update it as per your request.

9. Create the mapping file by putting the CSV file header name on left side and Salesforce API name on right side. Move the mapping file to  C:\DataLoaderFiles location. I have used the below sdl file for extracting account.

  1. #Mapping values for Account Extract  
  2. Id=Id  
  3. Name=Name  

Note:
Make sure to add all the fields you are trying to retrieve it in the sdl file.

10. Navigate to C:\Program Files (x86)\salesforce.com\Data Loader\samples\conf to get process-conf.xml file.

11. Move the process-conf file to  C:\DataLoaderFiles location.

12. Edit the file and enter your information.

  1. <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">  
  2. <beans>  
  3.   
  4.     <bean id="csvAccountExtractProcess"  
  5.           class="com.salesforce.dataloader.process.ProcessRunner"  
  6.           singleton="false">  
  7.       <description>csvAccountExtract job gets account info from salesforce and saves info into a CSV file."</description>  
  8.         <property name="name" value="csvAccountExtract"/>  
  9.         <property name="configOverrideMap">  
  10.             <map>  
  11.                 <entry key="sfdc.debugMessages" value="false"/>  
  12.                 <entry key="sfdc.debugMessagesFile" value="C:\DataLoaderFiles\sfdcSoapTrace.log"/>  
  13.                 <entry key="sfdc.endpoint" value="https://login.salesforce.com"/>  
  14.                 <entry key="sfdc.username" value="YOUR USERNAME"/>  
  15.                 <entry key="sfdc.password" value="ENCRYPTED PASSWORD"/>  
  16.                 <entry key="process.encryptionKeyFile" value="C:\Users\magulan\.dataloader\dataLoader.key"/>  
  17.                 <entry key="sfdc.timeoutSecs" value="600"/>  
  18.                 <entry key="sfdc.loadBatchSize" value="200"/>  
  19.                 <entry key="sfdc.entity" value="Account"/>  
  20.                 <entry key="sfdc.extractionRequestSize" value="500"/>  
  21.                 <entry key="sfdc.extractionSOQL" value="SELECT Id, Name FROM Account"/>  
  22.                 <entry key="process.operation" value="extract"/>  
  23.                 <entry key="process.mappingFile" value="C:\DataLoaderFiles\accountExtractMap.sdl"/>  
  24.                 <entry key="dataAccess.type" value="csvWrite"/>  
  25.                 <entry key="dataAccess.name" value="C:\DataLoaderFiles\extract.csv"/>  
  26.             </map>  
  27.         </property>  
  28.     </bean>  
  29.       
  30. </beans>  

Note:
Make sure to add all the fields you are trying to retrieve it in the extractionSOQL attribute. Make sure the sdl file also have those fields for the mapping.

13. Put process-conf and mapping sdl file into the new folder. In my case I have used C:\DataLoaderFiles.

14. Run process C:\DataLoaderFiles csvAccountExtractProcess to extract the data.
Note:
Make sure you are in Data Loader's bin folder to execute the command from the Command Prompt.