When to Use Admin, Triggers, or LWC in Salesforce

When to Use Admin, Triggers, or LWC in Salesforce

A customer walks into a store, and the staff instantly knows their preferences, past purchases, and even their favorite products. That’s the kind of experience Salesforce can create.

But to make it happen, we need to decide—should we use Admin tools or dive into development?

In this post, I’ll share a real-life example of how a Knowledge Base Portal in Salesforce used Salesforce to build a Customer Relationship. We’ll see how Admins, Developers, and LWC Developers worked together to make it possible.

By the end, you’ll have a clear idea of how to use Salesforce for your own needs.

Subscribed

Understanding the Tools

Let’s break down some of the key tools Salesforce offers, and how each one can help you achieve your goals.

Admin Features

Admin tools like Flows, Process Builder, and Validation Rules are your go-to for automating processes without writing any code.

These tools are great if you want to set up quick solutions, like automatically assigning leads, sending email alerts, or making sure data is entered correctly.

They’re super user-friendly, so even if you’re not a developer, you can still make a big impact with just a few clicks.

Triggers

Triggers are bits of code that automatically run when something happens in Salesforce—like when a record is created or updated. They’re essential when you need more complex logic that the Admin tools can’t handle.

For example, you can use triggers to update related records, enforce custom rules, or connect Salesforce with other systems.

LWC (Lightning Web Components)

LWC allows developers to build modern, fast, and dynamic interfaces that can really take your user experience to the next level.

They’re reusable, lightweight, and built using web standards, so they’re future-proof. Whether you’re creating a real-time dashboard or an interactive form, LWCs give you full control over the design and performance.

Each of these tools plays a unique role, and together, they help you build scalable, efficient solutions.

Building a Knowledge Base Portal in Salesforce: From Scratch to Completion

Creating a self-service portal for your customers to search knowledge articles, submit cases, and interact with agents is a great way to enhance customer experience and reduce support costs.

In this article, we’ll walk through how to build this Knowledge Base Portal using Salesforce Admin tools, Flows, Apex, Triggers, and Lightning Web Components (LWC), from scratch to finish.

Requirements:

  • Customers should be able to easily submit cases via a form with required details like case type and description.
  • Cases should be automatically assigned to the appropriate support agents based on predefined rules.
  • Customers must be able to track the status of their cases (New, In Progress, Resolved, Closed).
  • Relevant knowledge articles should be suggested to customers based on the case description.
  • Email notifications should be sent to customers and agents for case submission, updates, and resolution.

Initial Activities to Set Up the Knowledge Base Portal

When you're ready to build a Knowledge Base Portal in Salesforce, there are a few foundational steps to take before you start implementing features like case submission, assignment, and email notifications.

Let’s break down the initial activities I would recommend to set things up the right way.

1. Define the Requirements Clearly

The first thing we need to do is gather all the requirements. Without a solid understanding of what we want to achieve, we can’t move forward effectively.

In this case, think about the key features your portal should have:

  • How will customers submit cases?
  • What information should be captured in each case?
  • How will cases be routed to agents?
  • What kind of notifications do we need to send to both customers and agents?

By laying out these questions and discussing them with stakeholders, you ensure everyone is aligned on expectations.

2. Enable Salesforce Knowledge

Next, you’ll need to enable Salesforce Knowledge. This is where all your articles will be stored and linked to cases. To do this:

  • Go to Setup, search for Knowledge, and enable it.
  • Configure article types, categories, and permissions so agents and customers can access relevant knowledge when needed.

It’s essential to understand how your articles will be categorized and who will have access to them. These articles will become the backbone of your self-service capabilities later on.

3. Create Case Record Types

For effective case management, especially if you handle multiple types of customer issues (technical, billing, etc.), creating different Case Record Types is important. These record types allow you to customize how each type of case is tracked and managed.

  • Go to Setup, search for Record Types under the Case Object, and create new record types as needed.
  • Customize page layouts for each record type to ensure agents and customers see the right information.

This will help you keep your cases organized and streamline the process for your support team.

4. Set Up Case Fields and Page Layouts

With the record types in place, it's time to focus on the details. You need to configure the Case Object to capture the right information.

  • Modify the Case Page Layout to include fields like case type, description, customer details, and any other important information.
  • Use Validation Rules to ensure customers fill in necessary fields when submitting cases.

The goal here is to make sure the case submission form is simple yet captures all the relevant data needed to provide excellent support.

5. Configure Case Assignment Rules

Once cases start rolling in, you’ll need to assign them to the right agent. This is where Case Assignment Rules come into play. You can define rules based on factors like:

  • Case type
  • Priority
  • Product or service category
  • Region or location

Head over to Setup, find Case Assignment Rules, and start creating rules to automate this process. Testing these rules is crucial to ensure cases go to the right person every time.

6. Create Email Templates

Email notifications are essential for keeping everyone in the loop. As part of the initial setup, create Email Templates for notifications like:

  • Case submission confirmation for customers.
  • Updates when the case status changes.
  • Resolutions when cases are closed.

Using Process Builder or Workflow Rules, you can automate these notifications, so customers and agents never miss an update.

7. Set Up Case Status Tracking

One of the most important things for customers is knowing the status of their cases. Configure the Case Status field to include status options like:

  • New
  • In Progress
  • Resolved
  • Closed

You can even use Record Types to manage different workflows for different types of cases. Make sure the status field is included in the case page layout so it’s easily accessible to both agents and customers.

8. Prepare Knowledge Articles

Now comes the fun part: building the knowledge base. Start creating knowledge articles that are relevant to common issues customers face. Organize them into categories based on case types (e.g., technical issues, billing, product inquiries).

  • You’ll link these articles to the case records so customers and agents can find solutions quickly.

Having a robust knowledge base is essential for reducing case volume and enabling customers to solve their problems independently.

Admin Limitations for Knowledge Base Portal in Retail Business

When setting up a Knowledge Base Portal for a retail business using Salesforce Admin tools, here are the key limitations you’ll encounter:

  • Complex Business Logic:
  • Static Knowledge Article Linking:
  • Limited UI Customization:
  • Bulk Data Processing:
  • Basic Reporting:

Development Approach for Knowledge Base Portal

Now that we’ve covered the basics, let’s take a deeper dive into how we can use Apex, Triggers, and LWC for two critical scenarios in a Knowledge Base Portal for a retail business: Dynamic Knowledge Article Suggestions and Complex Case Routing.

1. Dynamic Knowledge Article Suggestions with Apex

When customers open a case, they may be looking for immediate solutions. Offering relevant knowledge articles can greatly enhance their experience and reduce case resolution time.

While Admin tools like Flows can associate static articles with cases, they cannot personalize or dynamically suggest articles based on real-time case details or customer history. This is where Apex comes into play.

What We Need:

  • A system to suggest knowledge articles dynamically based on the Case Type, Product, and Issue mentioned in the case.
  • Integration with the Knowledge Articles object to query and present these articles in real-time.

How We’ll Do It:

We will create an Apex Class to handle the logic of querying knowledge articles. Here's a step-by-step breakdown of what happens:

  1. Apex Class Structure: The class will receive the case details (such as product type or issue) and use those details to query the Knowledge Articles object.
  2. Querying Knowledge Articles: Based on keywords in the case description, product type, or customer history, the Apex Class will search for articles. For example, if a customer’s case mentions "washing machine not spinning," the class will search for troubleshooting articles related to that specific model or issue.


  1. Return Relevant Articles: Once the articles are queried, the system will present these to the customer or agent, making the knowledge base easy to access.
  2. Real-time Experience: With Apex, the articles are dynamically fetched, which means the system is always up-to-date and relevant based on the current case.

Benefits:

  • Customers get immediate access to self-service articles, which reduces case resolution time.
  • Agents can quickly view relevant articles, providing them with solutions that may reduce resolution time for the customer.

2. Complex Case Routing with Apex Triggers

In a retail environment, cases can vary widely in complexity. Routing a case based on the customer’s account type, product category, or even urgency can improve case resolution efficiency.

Admin tools, such as Case Assignment Rules, are useful for basic routing but fall short when complex logic is involved, such as handling multiple conditions.

What We Need:

  • A dynamic case routing system that uses criteria such as product category, account history, and case priority to route cases to specific teams.
  • Real-time assignment based on business rules that are too complex for declarative tools.

How We’ll Do It:

Create an Apex Trigger on Case Object: The trigger will fire when a new case is created or updated. The logic inside the trigger will evaluate different conditions to determine where the case should be routed.


  1. Define Complex Conditions: The logic within the trigger will evaluate multiple conditions:
  2. Real-Time Assignment: As soon as the case is created or updated, the trigger runs, evaluating all criteria and assigning the case to the correct agent or team in real-time.

Example Workflow:

  • A customer opens a case related to a high-end smartphone (Product Category: Electronics) and selects a high priority for the issue (e.g., broken screen). The trigger evaluates the conditions, and the case is routed to the Electronics Support Team.
  • On the other hand, a customer reporting a minor issue with a standard TV (Product Category: Electronics) but with a low priority is routed to the General Support Team.

Benefits:

  • Cases are routed automatically based on business rules, ensuring that the right team handles each case.
  • Complex business logic can be implemented easily, with Apex Triggers providing the flexibility to handle all conditions in real-time.

In Salesforce, both Admin tools and Development (Apex, Triggers, and LWC) have their places, depending on the complexity of the task at hand.

Thanks for reading JobWiseMentor! This post is public so feel free to share it.

Final Thoughts:

  • Admin tools are best for automating basic processes like workflows, approval processes, and case assignment rules.
  • Use Admin tools for simple configurations such as creating fields, updating page layouts, and managing user permissions.
  • Admin tools are ideal for building user-friendly solutions like record types, approval processes, and reports without needing to write any code.
  • Development tools (Apex, Triggers, LWC) are needed when your requirements involve complex business logic or conditions that cannot be achieved through Admin tools.
  • Development is required for customization, such as creating custom features or real-time data processing that involve more control over code.
  • Apex and Triggers are essential when you need to automate processes that involve multiple conditions or when real-time processing is needed.
  • Development tools are used when integration with external systems or custom solutions is required, which goes beyond what Admin tools can handle.
  • Admin tools are perfect for quick setups and basic automation, while Development tools are necessary for complex customizations and advanced logic.

That’s it for today! ??

Thank you for reading the full post. Since you read this till the end, it’s safe to assume you found value in the content.

Send it to your friends here to sign up, or share it on Linkedin!

Thanks for spending part of your day with Avinash Varikuti

要查看或添加评论,请登录

Avinash Varikuti的更多文章

  • Effective Bug Management in Salesforce

    Effective Bug Management in Salesforce

    Introduction Imagine you’re working on a Salesforce project, and suddenly, something doesn’t work as…

  • The Reality of the Job Market and the Importance of Research

    The Reality of the Job Market and the Importance of Research

    Do you truly know what is happening in the current job market? Before going into this discussion, let’s reflect for a…

  • Goodbye 2024 and Welcome to 2025

    Goodbye 2024 and Welcome to 2025

    In 2024, everyone experienced all kinds of emotions, and I believe I did too. I faced a mix of happiness, sadness, and…

  • Flow Mastery Day 14

    Flow Mastery Day 14

    Hello Awesome Flow Builders, Guess what? You finished the 14-day Salesforce Flow challenge! I'm so impressed with…

  • Flow Mastery Day 13

    Flow Mastery Day 13

    Hello everyone, Have you ever wished your Salesforce data could talk to other apps and websites? Maybe you need to…

  • Flow Mastery Day 12

    Flow Mastery Day 12

    Hello everyone, Tired of doing the same tasks over and over in Salesforce? This newsletter will give you ideas for…

  • Flow Mastery Day 11

    Flow Mastery Day 11

    Hey everyone, Are you ready to build a Flow that will take some serious work off your sales team's plate? Today, we're…

  • Flow Mastery Day 10

    Flow Mastery Day 10

    Hello everyone! Remember that amazing feeling when we built the Flow that automated those lead tasks? That was just the…

  • Flow Mastery Day 9

    Flow Mastery Day 9

    Make Your Lead Management Easier – Build Your Salesforce Flow! Intro Hello everyone, Tired of doing the same tasks over…

  • Flow Mastery Day 8

    Flow Mastery Day 8

    Salesforce Flows: The Future of Automation Picture this: you need something done in Salesforce – maybe updating…

社区洞察

其他会员也浏览了