Skip to main content


Generic Class to get Dependency of Dependent Pick-list In Apex

Dependent Picklist values Dependency Dependent Picklist values do not have any dependency when retrieved via Apex Code. This Following Class will returned a map which has Key as Controlling Values and Values are the list of dependent values(In LowerCase). Map Key =  Controlling Values, Map Values = list of dependent values. Class:- /***********************-- START --****************************** **/ /** * @File Name          : DependencyForPicklistApex.cls * @Description        : CR-DR * @Author             : Devraj Tomar * @Group              : DR Groups * @Last Modified By   : Devraj Tomar * @Modification Log   :  **/ public class DependencyForPicklistApex {          public static Map<String, Set<String>> getFieldDependencies(String objectName, String controllingField, String dependentField){         Map<String, Set<String>> controllingInfo = new Map<String, Set<String>>();         Schema.SObjectType objType = Schema.getGlobalD

Salesforce Winter ’20 Release Notes(Critical Updates and Security Alerts) - Summary

Summary - Salesforce Winter ’20 Release Critical Updates and Security Alerts Enable ICU(  International Components for Unicode ) Locale Formats (Critical Update) Restrict Access to @AuraEnabled Apex Methods for Guest and Portal Users Based on User Profile Restrict Access to @AuraEnabled Apex Methods for Authenticated Users Based on User Profile Use with sharing for @AuraEnabled Apex Controllers with Implicit Sharing Enforce Access Modifiers on Apex Properties in Lightning Component Markup Enable Partial Save for Invocable Actions Restrict Access to @AuraEnabled Apex Methods for Guest and Portal Users Based on User Profile  A guest, portal, or community user can access an  @AuraEnabled  Apex method only when the user’s profile allows access to the Apex class. This critical update enforces user profile restrictions for Apex classes used by Aura and Lightning web components. Restrict Access to @AuraEnabled Apex Methods for Authenticated Users Based on User Prof

LWC View On Local Server

1. Open a new terminal window and run the following command to install the local development server. sfdx plugins:install @salesforce/lwc-dev-server 2. Check for updates to the local development server. sfdx plugins:update 3. Navigate to your SFDX project, or clone one that has Lightning web components. In this example, we are using lwc-recipes (you can download and deploy to your org). git clone 4. if you have Existing LWC Components then goto that directory. In this example If you're not in the lwc-recipes root directory already, cd into it. cd lwc-recipes 5. Use the following command to host Local Server : sfdx force:lightning:lwc:start 6. View the server at http://localhost:3333/.

Apex Method Call In LWC

Apex method Call from LWC : syntax: import apexMethodName from '@salesforce/apex/Namespace.Classname.apexMethodName'; Example: public with sharing class ContactController { @AuraEnabled(cacheable=true) public static List<Contact> getContactList() { return [SELECT Id, Name, Title, Phone, Email, Picture__c FROM Contact WHERE Picture__c != null LIMIT 10]; } } Namespace = The namespace of the Salesforce organization. Classname = The Name of Apex Class apexMethodName = Method name to import apexMethodName = identify the apex method in js. Expose Apex Methods to Lightning Web Components: To expose an Apex method to a Lightning web component, the method must be static and either global or public . Annotate the method with @AuraEnabled . Primitive —Boolean, Date, DateTime, Decimal, Double, Integer, Long, and String. sObject —standard and custom sObjects are both supported. Apex —an instance of an Apex class. (Most often a custom class.) C

How to get Current User Info in Salesforce

Apex: Id currentUserId = UserInfo.getUserId(); VisualForce: <p>Current User Id: {!$User.Id}</p> <p>Current User Email: {!$User.Email}</p> AuraComponent: let currentUserId = $A.get("$SObjectType.CurrentUser.Id"); LWC: import CURRENT_USER_ID from '@salesforce/user/Id'; import CURRENT_USER_NAME from '@salesforce/schema/User.Name'; import CURRENT_USER_EMAIL from '@salesforce/schema/User.Email';

Platform App Builder Certification Maintenance (Winter ’20)

1. ' Use Accordian component' to organize components into collapsible sections on a home page. 2. ' DATEVALUE() ' formula provides a workaround for daylight savings time values. 3. ' 300 ' approval processes can be active for each object. 4. With ' Wrap Text ' a Sales reps can see all the text in the Description column in the insert email template window. 5. ' 2000 ' custom objects can an App Builder create. 6. On ' Flow builder canvas ' an App Builder will see a flow's scheduled start time. 7. Custom notification types are created in ' Notification Builder '. 8. An App Builder wants to Activate a Flow from the Flow Builder. The Activate button is located in ' button Bar '. Check out Comments for More Info:-

Admin Maintenance (Winter '20)

1. By ' Report on account team ' an Administrator use to determine different levels of team member access to an Account. 2. An Administrator needs to automatically add account team members to an account, ' Process Builder ' can be used by Administrator to meet this requirement.  3. Team Member Access button show ' Maximum access ' when selected. 4. To customize the opportunity contact roles go to --> 's etup-object manager-opportunity contact role '. 5. On ' Merge field ' picker an Administrator find a sender signature field. 6. ' 1000 ' approval processes can be active in one org. 7. ' Formula field ' reference type is available when an Administrator uses the "Where is this used?" button on a field? Check Comment for more details...

Platform Developer I Certification Maintenance (Winter '20)

1. ' Deselect show label option ' Is the action which hides the default label for the Visualforce page, When including a Visualforce page component in a Lightning Page using Lightning App Builder. 2. A developer needs to make changes to a custom field and associated Apex classes and triggers, ' On the Custom field’s detail page, click Where is this used ' the way by which a developer quickly determine which Apex classes and triggers use the field. 3. A developer is preparing to install a managed package that will create several new custom objects. The developer ' look the  number custom object and custom setting in system overview information ' to understand how many objects can be created prior to reaching the allowed limit for the org. 4. ' enableDisableParallelApexTesting ' is the ApexSettings metadata field which enables serial execution of Apex tests. 5. ' Apex code that sends HTTP request ' is excluded from the concurrent long-running

Load Bulk Records Using CSV with the Custom Metadata Loader

1. Download the Complete application Zip file from the git hub  Source . 2. Deploy the Downloaded Zip file into your org using below tools Ant Eclipse WorkBench 3. Once you have deployed the zip file successfully it will creates below components 10 Apex Classes 2  Apex Page 1  Custom Application 1  Custom meta data type 1  Custom tab 1  Permission Set 4. Goto Setup-->Permission Sets-->Click on Custom Metadata loader-->Manage Assignments 5. Click on Add Assignments -->Add the users to whom you want to give access for this App. 6. Goto Application menu Select Custom Metadata Loader application. 7. Clicking on Custom Metadata Loader you will be receiving below error. 8. To fix this issue do the following steps: Create a remote Site           Remote Site Name : Name (Example : c_mdapi )           Remote Site URL       : Copied page URL of the error page shown in Step-7.           Active                   

Feature Management Class

To check Custom Permission and Other Features Check and modify the values of feature parameters, and to show or hide custom objects and custom permissions in your subscribers’ orgs. Syntax: FeatureManagement.checkPermission('CustomPermission_apiName'); Return Type: Boolean Example :  public   static   Boolean havingCperm =   FeatureManagement. checkPermission( apiName); OR if( FeatureManagement. checkPermission( apiName) ){your logic} ClickHere for More Details. For information about feature parameters, see “Get Started with the Feature Management App” in the  ISVforce Guide . In TestClass  to assign PermissionSet Use:  PermissionSet   ps  = [SELECT  Id , Name  FROM  PermissionSet  WHERE  Name  =  'apiName' ]; PermissionSetAssignment   psa  =  new   PermissionSetAssignment (); psa . AssigneeId  =  UserInfo . getUserId (); psa . PermissionSetId  =  ps . Id ; insert   psa ;