SOQL Execution Time using Developer Console in Salesforce
Option 1: 1. Go to Developer Console. 2. Navigate to Debug --> View Log Panels… 3. Select Execution Stack. Sample Code with SOQL to execute in Anonymous Window: List < ....
Option 1: 1. Go to Developer Console. 2. Navigate to Debug --> View Log Panels… 3. Select Execution Stack. Sample Code with SOQL to execute in Anonymous Window: List < ....
Sample Code: Lightning Component: <aura:component implements = "force:appHostable"> <aura:attribute name = "str" type = "String"/> <aura:handler name = "init" value = "{!this}" action = "{!c.onInit}"/> <div class = "slds-box slds-theme_default"> String is {! v.str } </div> </aura:component> Lightning Controller: ({ onInit : function( component, event, helper ) { var temp = 'testing'; var tmp = temp.substr( -2 ); component.set( "v.str", tmp ); } }) ....
In the below example, I have updated the contact name to 'Testing'. Sample code: Lightning component: <aura:component implements = "force:appHostable" controller = "AccountListController"> <aura:attribute type = "object[]" name = "acctList"/> <aura:handler name = "init" value = "{!this}" action = "{!c.onInit}"/> <div class = "slds-box slds-theme_default"> <aura:iteration items = "{! v.acctList }" var = "acc"> Account Name - {! acc.Name }<br/> <aura:iteration items = "{! acc.Contacts }" var = "con"> ....
Sample SOQL: SELECT Name, PermissionsEditEvent FROM Profile WHERE PermissionsEditEvent = true Output:
Sample SOQL: SELECT BillingPostalCode FROM Account WHERE BillingPostalCode != NULL AND BillingPostalCode LIKE '___-__' Output:
Sample SOQL: SELECT Name, PermissionsEditTask FROM Profile WHERE PermissionsEditTask = true Output:
Sample Query: SELECT Name, PermissionsViewAllUsers, PermissionsViewEventLogFiles FROM Profile
Sample Code: Set < String > listsObjs = new Set < String > {'Account', 'Lead'}; Map<String, Schema.SObjectType > globalDescription = Schema.getGlobalDescribe(); for ( String obj : listsObjs ) { Schema.sObjectType objType = globalDescription.get( obj ); Schema.DescribeSObjectResult r1 = objType.getDescribe(); Map<String , Schema.SObjectField > mapFieldList = r1.fields.getMap(); for ( Schema.SObjectField field : mapFieldList.values() ) { Schema.DescribeFieldResult fieldResult = field.getDescribe(); String fieldLabel = fieldResult.getLabel().toLowerCase(); Schema.DisplayType fielddataType = fieldResult.getType(); if ( fielddataType == Schema.DisplayType.Email ) { System.debug( objType + '.' + fieldResult.getName() ); } else if ( fieldLabel.contains( 'email' ) && ! fieldResult.isCalculated() ) { System.debug ( objType + '.' + fieldResult.getName() ); } ....
Sample Code: Set < String > listsObjs = new Set < String > {'Account', 'Lead'}; Map<String, Schema.SObjectType > globalDescription = Schema.getGlobalDescribe(); for ( String obj : listsObjs ) { Schema.sObjectType objType = globalDescription.get( obj ); Schema.DescribeSObjectResult r1 = objType.getDescribe(); Map<String , Schema.SObjectField > mapFieldList = r1.fields.getMap(); for ( Schema.SObjectField field : mapFieldList.values() ) { Schema.DescribeFieldResult fieldResult = field.getDescribe(); String fieldLabel = fieldResult.getLabel().toLowerCase(); Schema.DisplayType fielddataType = fieldResult.getType(); if ( ( fieldLabel.contains( 'first name' ) || fieldLabel.contains( 'last name' ) || fieldLabel.contains( 'firstname' ) || fieldLabel.contains( 'lastname' ) ) && ! fieldResult.isCalculated() ) { System.debug ( objType + '.' + fieldResult.getName() ); } } } In the ....
1. Execute the below code in Developer Console. for ( Profile objProfile : [ SELECT Name, ( SELECT Id, IsActive FROM Users ) FROM Profile ORDER BY Name ] ) ....