Skip to main content

Posts

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 git@github.com:trailheadapps/lwc-recipes.git 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...

Translate