Skip to main content

Posts

Showing posts from April, 2020

Filter any report by current Logged In User in Salesforce | Salesforce Tutorials | Salesforce Development

How to send WhatsApp from Lightning Component Salesforce ?

Send WhatsApp from Lightning Component SalesforceHi folks, in this article I will explain how you can send WhatsApp from Lightning Component using https://wa.me/
In this example I will create a Quick Action button on Contact which will be connected with my Lightning Component.
Please follow the steps below : 
Step 1 : Create a Lightning Component & Apex as shown below
WhatsApp.cmp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30<aura:componentcontroller="Vlog_whatsappCTRL"implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction"access="global"><aura:attributename="recordId"type="String"/><aura:attributename="con"type="Contact"/><aura:attributename="msg"type="String"/><aura:handlername="init"action…

How to add Pagination in Lightning Data Table ?

Add Pagination in Lightning Data Table...Hello folks, please follow below code to add pagination in Lightning Data Table in Lightning Component.
AddPagination.cmp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37<aura:componentcontroller="LightningDataTableCTRL"implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction"access="global"><aura:attributename="recordList"type="List"/><aura:attributename="columns"type="List"/><aura:attributename="pageNumber"type="Integer"default="1"/><aura:attributename="pageSize"type="Integer"default="10"/><aura:attributename="isLastPage"type="Boolean"default="false"/><aura:attribu…

Truncate String with Line Clamp in Lightning Component Salesforce

Line Clamp in Lightning Component SalesforceHi folks, in this blog I will share the details about "Line Clamp". Trust me it could be a life saver for the designers.
So in one line Line Clamp allow you to multi-line text truncation. 
In line clamp we are having 3 css blocks. Please check below example to understand it better.
1. slds-line-clamp_small It will truncate the text on line 3 as shown below : 

1 2 3 4 5 6 7<divstyle="width:800px; font-size:large"><pclass="slds-line-clamp_small"> Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sect…

Check for duplicate Leads & Contact using Trigger

How to check for duplicate Leads if a Contact already exist with the same Email ?
Hello folks, in this post you will learn to create a trigger on Lead to check for duplicate records if a Contact is already exist with same email address. 
Please follow below code : 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15trigger CheckDuplicateLeads on Lead (before insert, before update) { for (Lead myLead : Trigger.new) { //Check if the email is not nullif (myLead.Email !=null) { //Get list of contact with the same email we have used in Lead List<Contact> con = [SELECT Id FROM Contact WHERE Email =:myLead.Email]; //Check if the list is not emptyif (con.size() >0) { //Action if duplicate } else { //Action if Unique } } } }



Please check below links also and subscribe if you like the content :  How to get Parent Id from encoded URL in Lightning Componen…

Get Parent Id when overriding standard actions with a Lightning Component in salesforce1 app

How to Get Parent Id when overriding standard actions with a Lightning Component in salesforce1 app ?
In this blog I will explain how you can get Parent Id when overriding standard actions with a lightning component.
For example I have changed my Opportunity New button action with a custom Lightning Component. 
Let's create a new account and from the related tab try creating the new Opportunity. Have you noticed any change in URL ?
Let me share the URL with you :  _________________________________________________________________________ https://kapilbatra1-dev-ed.lightning.force.com/lightning/o/Opportunity/new?recordTypeId=0127F000000htlpQAA&additionalParams=accid%3D0017F00002S6g9H%26&inContextOfRef=1.eyJ0eXBlIjoic3RhbmRhcmRfX3JlY29yZFBhZ2UiLCJhdHRyaWJ1dGVzIjp7Im9iamVjdEFwaU5hbWUiOiJBY2NvdW50IiwicmVjb3JkSWQiOiIwMDE3RjAwMDAyUzZnOUhRQVIiLCJhY3Rpb25OYW1lIjoidmlldyJ9LCJzdGF0ZSI6e319&count=3 _________________________________________________________________________
In above URL you …