Skip to content
Shivam Laidwar edited this page Sep 21, 2023 · 1 revision

Contact Search LWC

This Lightning Web Component (LWC) allows you to search for a Contact in your Salesforce database by name. It provides a simple interface to input the Contact's name and checks if the Contact exists. Green color's Toast message for searched contact and Red color's Toast message for not searched contact.

Features

  • Search for a Contact by name.
  • Displays a toast message with the search result.

Installation

To use this component in your Salesforce org, you can deploy it using Salesforce CLI or Salesforce Extensions for Visual Studio Code. Here are the steps:

  1. Clone this repository to your local machine:

    https://github.com/s4SHIVam7/contactSearch_lwc.git
    

Deployment

  1. To deploy the component to your Salesforce org using Salesforce CLI, run the following command:
sfdx force:source:deploy -p force-app/main/default
  1. Once deployed, add the component to your Lightning App or Lightning Record Page.

  2. Use the "Contact Search" component to search for Contacts by name.

Usage

Enter the Contact's name in the input field.

Click the "Search" button.

If the Contact is found, a success toast message will be displayed as "Contact Found In Database!".

If the Contact is not found, an error toast message will be displayed as "Contact Not Found In Database".

ScreenShot

  1. Main Component image

  2. Successful Output image

  3. Valid Error Output image

Clone this wiki locally