The Developer Console didn't set the DEVELOPER_LOG trace flag on your user. Having an active trace flag triggers debug logging. You have 260 MB of the maximum 250 MB of debug logs. Before you can edit trace flags, delete some debug logs.

1. In developer console, Select tab "Query Editor" at the bottom of the console.

2. Select check box "Use Tooling API".

3. Execute the below query:

  1. SELECT Id FROM ApexLog  

4. Select All Rows. Click the first row and then press Shift button and click last row to select all the rows. Delete all rows using Delete button.


How to sign up for Salesforce Spring '19 Pre-Release org?

1. Go to https://www.salesforce.com/form/signup/prerelease-spring19.jsp.

2. Enter all the information and click Start Free Trial button.


3. You will receive an email with credentials.

Printable view in reports in Lightning Experience

1. On a report click on the drop-down by 'Edit' button and select 'Export'.


2. You will see two options for export now, 'Formatted Excel' and 'Details Only'.

3. Formatted Excel is new version of printable view.


Custom Lightning Template with adjustable width in percentage in Salesforce

Sample code:

Component:


  1. <aura:component implements="lightning:recordHomeTemplate">  
  2.       
  3.     <aura:attribute name = "left" type = "Aura.Component[]" />  
  4.     <aura:attribute name = "middle" type = "Aura.Component[]" />  
  5.     <aura:attribute name = "right" type = "Aura.Component[]" />  
  6.       
  7.     <table>  
  8.         <tr cellpadding = "8" cellspacing = "8" style="vertical-align:top;">  
  9.             <td width="14%">{!v.left}</td>  
  10.             <td width="1%"></td>  
  11.             <td width="45%">{!v.middle}</td>  
  12.             <td width="1%"></td>  
  13.             <td width="39%">{!v.right}</td>  
  14.         </tr>  
  15.     </table>  
  16.       
  17. </aura:component>  

Design:


  1. <design:component>  
  2.       
  3.     <flexipage:template >  
  4.           
  5.         <flexipage:region name = "left" defaultwidth = "Medium"/>          
  6.         <flexipage:region name = "middle" defaultwidth = "Medium"/>          
  7.         <flexipage:region name = "right" defaultwidth = "Medium"/>  
  8.           
  9.     </flexipage:template>  
  10.       
  11. </design:component>  

Output:



How to check SOQL performance?

1. Go to Developer Console.

2. Navigate to Debug --> View Log Panels...


3. Select Execution Stack.


Trigger Execution Stack Developer console Salesforce


Visualforce Execution Stack Developer console Salesforce


Note:
Duration is in Milliseconds.



Download log from Developer Console in Salesforce

Right click the Log and click Download Log.


Or

File --> Download Log.


Custom Lightning Template with Scroll Options in Salesforce

Sample Code:

Lightning Component:

  1. <aura:component implements="lightning:recordHomeTemplate">    
  2.         
  3.     <aura:attribute name = "left" type = "Aura.Component[]" />    
  4.     <aura:attribute name = "middle" type = "Aura.Component[]" />    
  5.     <aura:attribute name = "right" type = "Aura.Component[]" />    
  6.         
  7.     <table>    
  8.         <tr cellpadding = "8" cellspacing = "8" style="vertical-align:top;">    
  9.             <td width="14%">    
  10.                 <div class="slds-scrollable" style="height:900px;">{!v.left}</div>    
  11.             </td>    
  12.             <td width="1%"></td>    
  13.             <td width="45%">    
  14.                 <div class="slds-scrollable" style="height:900px;">{!v.middle}</div>    
  15.             </td>    
  16.             <td width="1%"></td>    
  17.             <td width="39%">    
  18.                 <div class="slds-scrollable" style="height:900px;">{!v.right}</div>    
  19.             </td>    
  20.         </tr>    
  21.     </table>    
  22.         
  23. </aura:component>   

Design:


  1. <design:component>  
  2.       
  3.     <flexipage:template >  
  4.           
  5.         <flexipage:region name = "left" defaultwidth = "Medium"/>          
  6.         <flexipage:region name = "middle" defaultwidth = "Medium"/>          
  7.         <flexipage:region name = "right" defaultwidth = "Medium"/>  
  8.           
  9.     </flexipage:template>  
  10.       
  11. </design:component>  

Output:



SOQL Execution Time using Developer Console in Salesforce

1. Go to Debug --> Change Log Levels... in Developer Console.


2. Click Add/ Change.


3. Set Profiling to Finest.


4. Execute the query in the anonymous window.



5. You can find the execution time in the log.


How to find Right of string in Lightning Component Controller?

Sample Code:

Lightning Component:


  1. <aura:component implements = "force:appHostable">    
  2.       
  3.     <aura:attribute name = "str" type = "String"/>  
  4.       
  5.     <aura:handler name = "init" value = "{!this}" action = "{!c.onInit}"/>  
  6.       
  7.     <div class = "slds-box slds-theme_default">   
  8.       
  9.         String is {! v.str }  
  10.           
  11.     </div>  
  12.         
  13. </aura:component>  

Lightning Controller:


  1. ({    
  2.       
  3.     onInit : function( component, event, helper ) {    
  4.           
  5.         var temp = 'testing';  
  6.         var tmp = temp.substr( -2 );  
  7.         component.set( "v.str", tmp );  
  8.           
  9.     }  
  10.       
  11. })  

Output:



How to update Sub Query data in Lightning Component JavaScript Controller?

In the below example, I have updated the contact name to 'Testing'.

Sample code:

Lightning component:


  1. <aura:component implements = "force:appHostable"  
  2.                 controller = "AccountListController">    
  3.       
  4.     <aura:attribute type = "object[]" name = "acctList"/>    
  5.       
  6.     <aura:handler name = "init" value = "{!this}" action = "{!c.onInit}"/>  
  7.       
  8.     <div class = "slds-box slds-theme_default">   
  9.   
  10.         <aura:iteration items = "{! v.acctList }" var = "acc">   
  11.               
  12.             Account Name - {! acc.Name }<br/>  
  13.               
  14.             <aura:iteration items = "{! acc.Contacts }" var = "con">   
  15.                   
  16.                 Contact Name - {! con.Name }<br/>  
  17.                   
  18.             </aura:iteration>  
  19.               
  20.         </aura:iteration>  
  21.           
  22.     </div>  
  23.         
  24. </aura:component>  

Lightning controller:


  1. ({    
  2.       
  3.     onInit : function( component, event, helper ) {    
  4.           
  5.         var action = component.get( "c.fetchAccts" );    
  6.         action.setCallback(this, function( response ) {      
  7.                 
  8.             var state = response.getState();     
  9.             if ( state === "SUCCESS" )   {    
  10.                     
  11.                 var records = response.getReturnValue();    
  12.                 for ( var i = 0; i < records.length; i++ ) {    
  13.                       
  14.                     if ( records[i].Contacts && records[i].Contacts.length > 0 ) {  
  15.                           
  16.                         var records1 = records[i].Contacts;  
  17.                           
  18.                         for ( var j = 0; j < records1.length; j++ ) {  
  19.                               
  20.                             records1[j].Name = 'Testing';  
  21.                               
  22.                         }  
  23.                           
  24.                     }  
  25.                         
  26.                 }    
  27.                 component.set( "v.acctList", records );       
  28.                     
  29.             }    
  30.                 
  31.         });      
  32.         $A.enqueueAction(action);   
  33.           
  34.     }  
  35.       
  36. })  

Apex Class:


  1. public class AccountListController {    
  2.         
  3.     @AuraEnabled    
  4.     public static List < Account > fetchAccts() {    
  5.             
  6.         return [ SELECT Id, Name, Industry, Type, CreatedDate,  
  7.                         ( SELECT Name FROM Contacts )  
  8.                    FROM Account   
  9.                   LIMIT 100 ];    
  10.             
  11.     }      
  12.         
  13. }  

Output: