Skip to main content

Posts

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 ;

Relationship In Salesforce

Relationship In Salesforce 1. Master-detail relationship 2. Lookup relationship 3. Self-relationship 4. External lookup relationship 5. Indirect lookup relationship 6. Many-to-many relationship (junction object) 7. Hierarchical relationship Master-detail relationship It is a strongly coupled relationship among Salesforce objects, which means if a master record gets deleted, then the child records associated with it are also deleted. In this type of relationship, the parent record controls the behavior of the child record regarding visibility and sharing . It means the security setting of a parent object applies to the child object. When there is a master-detail relationship between two objects, you can create a unique type of field over the master object, called  Roll-up summary . A roll-up summary field allows us to calculate values from child records, such as the number of child records linked to a parent record. Lookup relationship It is a loosely coupled relations

Salesforce Platform features (MVC pattern)

A  controller  can send commands to its associated view to change the view’s presentation of the model (e.g., by scrolling through a document). It can also send commands to the model to update the model’s state (e.g., editing a document). A  model  notifies its associated views and controllers when there has been a change in its state. This notification allows the views to produce updated output, and the controllers to change the available set of commands. A  view  requests from the model the information that it needs to generate an output representation. Some Examples: 1. Visual Force pages, Page Layouts, Tabs comes under View Layer of Model View controller . 2. Workflows, Apex Classes, Triggers, Validation Rules comes under Controller part in Model View controller . 3. Objects, Fields, Relationships comes under Model Layer of Model View Controller .

VS Code And Salesforce CLI Setup

Download VS Code From the Below Link For Windows : Windows x64   For Mac :    macOS For Linux :   Linux x64 .deb Install the Salesforce CLI  You install the Salesforce CLI Download the .pkg file. Double-click the .pkg file. Verify Your Installation Verify your Salesforce CLI installation and plug-in versions. Run this command to verify the Salesforce CLI version:  sfdx --version Salesforce Extension Pack Install the Salesforce Extension Pack in VS Code : INSTALL

Translate