Salesforce Lightning

Pop-up within a pop-up in Lightning Aura Component.

In salesforce we can have only one popup at a time. So, if you are using a popup, then you have to use a work around to display popup.

Here in this blog, I will show you how to display a popup within a popup. We will create 2 components in this demo.

  1. Child Component (Second popup modal)
  2. Parent Component (Actual Popup modal)

So, when user chicks on a button we will display a pop-up window and when user clicks on success button we will display another child pop-up modal.

Continue reading “Pop-up within a pop-up in Lightning Aura Component.”
Salesforce Admin · Salesforce Basic

How to get Picklist value in Formula Field.

When it comes to picklist in formula fields, there are few things which developer need to consider.

  1. Do you want picklist actual value (return text value)?
  2. Do you want to check if user has selected a specific value (return true or false.)?

There are 3 functions that can be used for different purpose to work with picklists in formula field.

  1. ISPICKVAL()
  2. CASE()
  3. TEXT()
Continue reading “How to get Picklist value in Formula Field.”
Governor Limits

Using Limit class in Salesforce

We know that salesforce works on the concept of Multi-Tenancy, because of which there are many governor limits that are in place to use the salesforce server resources smoothly. To check the limitations of in apex class as per specific scenario, we can make use of standard limit class.

The Limits methods return the specific limit for the particular governor, such as

  • the number of calls of a method
  • the amount of heap size remaining.
  • Query Limits
  • Queueable Jobs
  • Number of API calls
  • Limits on DML statements
Continue reading “Using Limit class in Salesforce”
Trailhead

Security.stripInaccessible

When working on DML operation in salesforce from Apex class developer might miss the security permissions that are assigned to different users through profiles, permission sets, sharing rules etc. This can lead to an exception. In this blog we will just see the solution for trailhead module for PD-1 certification. I will cover more details about stripInaccessible feature in a separate blog.

Continue reading “Security.stripInaccessible”
Salesforce Lightning

KeyCode of a key pressed in Lightning Web Component

There will be a scenario where you need to identify if Enter is presses or any special character is pressed. Below code will demonstrate how to identify a keypress code. In Lightning Web Component.

For this scenario we need to add a span section with onkeypress event above the input text field. And call a JS method. Something like this.

Continue reading “KeyCode of a key pressed in Lightning Web Component”
Salesforce Lightning

Toast Message in Lightning Web Component

It is always a good practice to display a toast message so that users are aware of what is happening in system. A toast message can be show to user when you want to show a Success message or an Error message or a Warning message. Toast message is simple to write and very effective.

In this blog we will see all 3 ways in which we can display a toast message. A toast can also simply provide information. To display a toast notification in Lightning Experience or Lightning communities, import ShowToastEvent from the lightning/platformShowToastEvent module.

When you dispatch an event to show the toast message you need to know few properties that are used in toast message.

Continue reading “Toast Message in Lightning Web Component”
Salesforce Lightning

Calling Apex Method with Parameters from a Lightning Web Component

There will be ample scenarios where a developer must customize things in salesforce to meet the business requirement. Customization in Lightning Web Component (LWC) can be done in multiple ways based on requirement. One is using lightning-record-edit-form and lightning-record-form. With these developers will have very minimal control over the component. Another way is by calling a server-side method. With this, developers will have good control over the component and can achieve complex business requirement. In this blog we will see how we can call a server Apex Method with parameters from an LWC JavaScript(.JS) file.

There are few things to note when you want to call an apex method.

  1. Importing the Server-side method (apex class).
  2. Calling a Server-side method from JS method.
  3. Fetching the value that is returned.
Continue reading “Calling Apex Method with Parameters from a Lightning Web Component”
Salesforce Admin

Clickable Custom formula field (Relative vs Absolute)

Developers usually get strange requests from client to make some of the text clickable so that if a user clicks on that field in record it should redirect to detailed page of that record. We know that standard Name field already does similar task. However there will be a scenario where client uses Standard name field as auto number field and a custom field to save proper name and requests for a clickable link on the custom field and requests to make it clickable.

There are multiple ways in which we can perform this task. But in this blog we will see 2 ways using formula field.

One simple way that everyone follows is using a relative URL, where you can create a custom formula field and use relative URL with record Id.

Continue reading “Clickable Custom formula field (Relative vs Absolute)”
Salesforce Lightning

Custom Lightning Component in Outlook or Gmail Side Panel

Sales reps depend on 2 important tools one is CRM to store information related to opportunities and leads and second is emails to communicate with contacts. CRM and Email are 2 different applications and sometimes it is annoying to toggle between apps to create records in salesforce when user is busy following up with multiple clients or customers at a time viz emails. It is also important to keep track of all interactions, activities and events into Salesforce.

The “Salesforce Lightning for Outlook” add-in can solve this problem. This plugin will give user a small side window panel, where user can create records in salesforce without having to login to salesforce separately in a browser. This will be like mobile version of salesforce in outlook.

Salesforce Lightning For Outlook Add-On search result.

Once you install the plugin, you need to login to either sandbox instance or Production Instance. You can create records of almost all objects. If you want a specific record type record to be created, you can create Global Actions for the same. This is a standard feature of salesforce.

There will be some scenarios where you may need to customize things as per business scenarios. And to add the custom-built logic, sometimes you need to build a custom solution either in Lightning Aura Component or in Lightning Web Component. But how to add the custom build module in the side panel in your outlook or Gmail plugin, we will see that in this post.

Continue reading “Custom Lightning Component in Outlook or Gmail Side Panel”