Blending Best of Both Worlds: React JS into Salesforce Lightning Web Components (LWC)

Integrating React within a Salesforce Lightning Web Component (LWC) is a unique approach since LWC and React are both frameworks designed to control the DOM in their ways. However, it is possible to use them together, though it requires careful handling to ensure both libraries can coexist without issues.

React JS within LWC

Step 1: Setting Up Your Salesforce DX Environment

  1. Install Salesforce CLI: Make sure you have the Salesforce CLI installed on your computer. This is essential for creating and managing your Salesforce development projects.
  2. Create a New Salesforce DX Project: Open your terminal and run the command sfdx force:project:create -n myLwcReactProject to create a new project.
  3. Navigate into Your Project: Use cd myLwcReactProject to move into your project directory.
  4. Authorize a Dev Hub: If you haven’t already, authorize a Salesforce Dev Hub by running sfdx auth:web:login -d -a DevHub.
  5. Create a Scratch Org: Create a new scratch org with sfdx force:org:create -s -f config/project-scratch-def.json -a LwcReactOrg.
  6. Open the Scratch Org: To access your newly created org, use sfdx force:org:open.

 Install the lwc-react package. You can do this by running the following command in your terminal:

npm install lwc-react

Step 2: Import React to Your Salesforce Project

  1. Navigate to the LWC Directory: Within your project, navigate to force-app/main/default/lwc.
  2. Create a React App: You cannot directly create a React app here. Instead, you’ll integrate React manually. Download React and ReactDOM from a CDN or NPM and include them in your Salesforce static resources.
  3. Static Resource for React: Create a static resource for both React and ReactDOM. Use Salesforce Setup to upload these files as static resources.

Step 3: Creating Your LWC Component

  1. Generate LWC Component: Use sfdx force:lightning:component:create --type lwc -n myReactComponent -d force-app/main/default/lwc.
  2. Edit Your Component: In your myReactComponent directory, you’ll find three files: myReactComponent.js, myReactComponent.html, and myReactComponent.css. You’ll primarily work with the JS and HTML files.

Step 4: Integrating React into Your LWC

  1. Load React and ReactDOM: In myReactComponent.js, use loadScript from lightning/platformResourceLoader to load React and ReactDOM from the static resources you uploaded.
  2. Use React in Your Component: After loading React and ReactDOM, you can use them within the renderedCallback lifecycle method to render React components inside your LWC.
  3. Update Your HTML Template: Add a container in your myReactComponent.html where the React component will be mounted.

There is React Library published by Salesforce which can be used seamlessly within LWC

https://react.lightningdesignsystem.com/

import { LightningElement, track } from 'lwc';
import { loadScript } from 'lightning/platformResourceLoader';
import REACT from '@salesforce/resourceUrl/react';
import REACTDOM from '@salesforce/resourceUrl/reactdom';

export default class MyReactComponent extends LightningElement {
    reactInitialized = false;

    renderedCallback() {
        if (this.reactInitialized) {
            return;
        }
        this.reactInitialized = true;

        Promise.all([
            loadScript(this, REACT + '/react.production.min.js'),
            loadScript(this, REACTDOM + '/react-dom.production.min.js')
        ])
        .then(() => this.initializeReactComponent())
        .catch(error => console.error(error));
    }

    initializeReactComponent() {
        ReactDOM.render(
            React.createElement('div', null, 'Hello from React!'),
            this.template.querySelector('.reactContainer')
        );
    }
}

Add a container in your myReactComponent.html where the React component will be mounted

<template>
    <div class="reactContainer"></div>
</template>

Considerations

  • Performance: Embedding React inside an LWC can impact performance because of the overhead of loading React and managing two frameworks.
  • Framework Conflicts: Be mindful of potential conflicts between React’s and LWC’s handling of the DOM.
  • Maintenance: This approach requires careful maintenance, as updates to either framework can necessitate changes to your integration.

For more details

https://twirltech.in/architect-blogs/

Salesforce Marketing Cloud Growth Edition: A Game Changer

The Salesforce Marketing Cloud Growth Edition is a newly announced product designed specifically to cater to the needs of small to medium-sized businesses, facilitating their growth by leveraging data and AI technologies. This edition is part of Salesforce’s broader strategy to make advanced marketing automation tools more accessible to smaller companies, helping them to grow their businesses efficiently.

  • Integration with Data Cloud: Salesforce is offering no-cost access to Data Cloud for Marketing Cloud Engagement and Marketing Cloud Account Engagement customers who have Sales or Service Enterprise Edition licenses or above. This move is aimed at providing these customers with tools to achieve better business outcomes through faster market speed, more relevant content generation, increased conversions, and the ability to connect conversations across the entire customer relationship lifecycle​​.
  • Focus on AI and Efficiency: The Growth Edition aims to help brands grow by delivering campaigns and content more quickly with trusted AI and better personalizing customer relationships with data. It is designed to allow small teams to do more with fewer resources, laying a strong data foundation essential for successful generative AI, and leveraging enterprise AI capabilities for the first time​​.
  • Accessibility and Innovation: Although the Marketing Cloud Growth Edition brings new functionality, existing Marketing Cloud users do not need to switch to this new edition. Salesforce is committed to bringing further innovations to all its Marketing Cloud products, ensuring that all customers, regardless of the edition they use, can benefit from the platform’s capabilities​​.

The Salesforce Marketing Cloud Growth Edition introduces a suite of features and capabilities aimed at addressing and overcoming common marketing challenges faced by businesses, particularly small to medium-sized enterprises (SMEs)

1. Accessibility and Usability

  • Challenge Addressed: Complexity of marketing automation tools.
  • How Growth Edition Changes This: The Growth Edition simplifies the user experience, making it more accessible for businesses with limited technical expertise. By offering an intuitive interface and streamlined processes, it lowers the entry barrier for SMEs to adopt and effectively utilize marketing automation.

2. Data Integration and Management

  • Challenge Addressed: Fragmented customer data across platforms.
  • How Growth Edition Changes This: With the integration of Data Cloud, the Growth Edition allows for better data management and analytics capabilities. It enables businesses to consolidate their customer data across various touchpoints into a single, cohesive view, enhancing personalized marketing efforts and customer understanding.

3. AI and Personalization

  • Challenge Addressed: Delivering personalized customer experiences at scale.
  • How Growth Edition Changes This: Leveraging Einstein AI, the Growth Edition provides AI-driven insights and recommendations. This allows for more targeted and personalized marketing campaigns, improving engagement and conversion rates without requiring extensive manual analysis.
  • Explore more here https://help.salesforce.com/s/articleView?id=sf.mktg_einstein_model_card_emg.htm&type=5

4. Scalability and Flexibility

  • Challenge Addressed: Need for a solution that grows with the business.
  • How Growth Edition Changes This: Designed for scalability, the Growth Edition meets the needs of growing businesses by offering flexible features that adapt to increasing complexity in marketing strategies and customer base expansion.

5. Cost-Effectiveness

  • Challenge Addressed: High costs associated with marketing technology.
  • How Growth Edition Changes This: By tailoring its offering to the needs and budgets of smaller businesses, the Growth Edition provides a cost-effective entry point into advanced marketing automation, making it financially accessible for SMEs.

6. Streamlined Marketing Operations

  • Challenge Addressed: Operational inefficiencies in executing marketing campaigns.
  • How Growth Edition Changes This: The Growth Edition automates repetitive tasks and streamlines campaign management, freeing up time for strategic thinking and creativity. This efficiency gain translates into faster time-to-market and more effective use of resources.

7. Enhanced Customer Journeys

  • Challenge Addressed: Creating cohesive customer journeys across channels.
  • How Growth Edition Changes This: It offers tools to design and manage customer journeys seamlessly across multiple channels, ensuring a consistent and engaging customer experience. This holistic view of the customer journey helps in optimizing touchpoints and improving overall satisfaction.
Marketing Cloud Growth Edition
Marketing Cloud Growth Edition

As this Marketing edition is now on core Salesforce Platform means developer has to adhere to the Governor limits more carefully. Please check you the details here https://help.salesforce.com/s/articleView?id=sf.mktg_admin_limits_ref.htm&type=5

Explore more architectural blogs at https://twirltech.in/architect-blogs/

Unlocking the Power of Salesforce Data Cloud: A Comprehensive Guide for Businesses

Are you ready to unleash the full potential of your business by harnessing the power of data? Look no further than Salesforce Data Cloud – a game-changing tool that empowers businesses with invaluable insights and strategic advantages. This comprehensive guide will delve into the depths of Salesforce Data Cloud, exploring its myriad benefits and unlocking its true power for your organization. Get ready to supercharge your decision-making processes, unlock hidden opportunities, and take your business to new heights with this ultimate resource!

Salesforce Data Cloud

Introduction to Salesforce Data Cloud

Salesforce Data Cloud is a powerful platform that enables businesses to unlock their customer data’s full potential. It is an integrated solution that combines data management, analytics, and AI capabilities to provide a holistic view of customer information. With its vast consumer and business data collection, Salesforce Data Cloud helps businesses gain valuable insights into their target audience, enhance their marketing strategies, and drive growth.

https://www.salesforce.com/in/products/genie/overview/

What is the Salesforce Data Cloud?

Salesforce Data Cloud is a cloud-based platform that offers access to one of the world’s largest collections of third-party consumer and business data. This includes over 30 billion records from over 300 million active users globally. The platform also provides real-time updates on demographic, firmographic, behavioral, and purchase intent data from various sources, such as social media platforms, government agencies, credit agencies, and more.

The primary goal of Salesforce Data Cloud is to help companies leverage this vast amount of data to understand their customers and create personalized experiences for them at every touchpoint. By integrating with the Salesforce Customer 360 platform, businesses can seamlessly connect customer data across multiple channels and devices.

Benefits of Using Salesforce Data Cloud

Salesforce Data Cloud is a powerful tool that has revolutionized how businesses handle and analyze customer data. With its advanced features and capabilities, Salesforce Data Cloud offers a wide range of benefits to businesses looking to maximize the potential of their data. This section will explore some of the key benefits of utilizing Salesforce Data Cloud for your business.

There are numerous benefits that businesses can reap by utilizing Salesforce Data Cloud:

1) Improved Customer Insights: With access to a diverse range of high-quality data points on consumers and businesses worldwide, companies can gain deeper insights into their target audience’s preferences, behavior patterns, buying habits, etc. This information allows them to personalize

2) Centralized Data Management:

One of the biggest advantages of using Salesforce Data Cloud is its ability to centralize customer data in one place. You no longer have to deal with fragmented data across different systems and platforms. With Salesforce Data Cloud, you can easily access and manage customer data from a single interface, allowing for better organization, collaboration, and analysis.

3) Real-Time Access to Relevant Customer Information:

Salesforce Data Cloud provides real-time access to relevant customer information, enabling businesses to make informed decisions based on accurate and up-to-date data. This is especially useful for sales teams who need quick insights into customers’ preferences, purchase history, and behavior patterns.

4) Enhanced Personalization:

With Salesforce Data Cloud’s advanced analytics capabilities, businesses can gain valuable insights into their customers’ behaviors and preferences. This allows them to personalize their marketing efforts and tailor their products or services according to individual needs, improving customer satisfaction and loyalty.

Visit https://twirltech.in/architect-blogs/ for more articles.

Options to Integrate Chat GPT with Salesforce

Open AI
Salesforce

In this section, we will go over the various options of chat gpt and salesforce integration. There are three ways to achieve Chat GPT with Salesforce:

  1. Build a custom integration using the Salesforce APEX to call GPT Model API
  2. Pre-built integration packages or solutions are available on the Salesforce AppExchange
  3. Create and Host a GPT model on any public cloud or local machine.

I don’t believe any ISV partner (https://appexchange.salesforce.com/) has already developed a package to integrate with the GPT Model. Also, creating and hosting a GPT model can be a complex task that requires a good understanding of machine learning and artificial intelligence.

GPT-3 is a pre-trained model that OpenAI provides; it is not publicly available to download and host on one’s local server or in the public cloud. So, options #2 and #3 are invalid at this moment.

Integrate GPT-3 Model API with Salesforce

We must use the API made available by the service that hosts the GPT model in order to call the predicted text from a Chat GPT model. Send an HTTP request from APEX to a specific endpoint. The body of the request is where you put any needed authentication information or parameters. High-level steps to Integrate Chat GPT with Salesforce

  1. Sign up for an API key from OpenAI
    • Go to the OpenAI website (https://openai.com/) and click on the “Sign In” button in the top right corner of the page.
    • After signing in, click on the “API” button at the top of the page.
    • Click on the “Create an API Key” button on the API page.
    • Provide a name for your API Key and select the permissions you want to grant to the key.
    • Click on the “Create” button to create the key.
  2. Once you have an API key, you can use it to request the GPT-3 API.
  3. The endpoint for generating text from a GPT-3 model is: https://api.openai.com/v1/engines/davinci-codex/completions
  4. You can make a POST request to this endpoint with a JSON payload that includes your API key, the text you want to generate completions for, and any other parameters you want to customize the generated text.
import json
import requests

api_key = "YOUR_API_KEY"
model = "davinci-codex"
prompt = "Write something interesting about Salesforce integration"

headers = {
    "Content-Type": "application/json",
    "Authorization": f"Bearer {api_key}"
}

data = {
    "prompt": prompt,
    "engine": model,
    "max_tokens": 50,
    "stop": ["Salesforce integration"]
}

response = requests.post(
    "https://api.openai.com/v1/engines/davinci-codex/completions",
    headers=headers,
    json=data
)

print(response.json())

Make a GPT-3 API HTTP request in Apex

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://api.openai.com/v1/engines/davinci-codex/completions');
request.setMethod('POST');
request.setHeader('Content-Type', 'application/json');
request.setHeader('Authorization', 'Bearer ' + apiKey);
request.setBody(jsonPayload);
HttpResponse response = http.send(request);

if (response.getStatusCode() == 200) {
    // Success, parse the JSON response
    Map<String, Object> jsonResponse = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
    // process the jsonResponse
}
else {
    // Handle the error
}

This merely illustrates how to use the GPT-3 API that OpenAI provides; other providers might require various endpoints, authentication methods, and parameters.

Browse Open API documentation about the endpoints

https://beta.openai.com/docs/models/gpt-3

It’s worth noting that OpenAI only provides the GPT models and not a chatbot service; however, the GPT models can be used as the core of a chatbot. But you must build the chatbot architecture, prompt and context management yourself.

Browse more at https://twirltech.in/architect-blogs/

Powerful Automation with No-Code Low-Code feature of Salesforce OmniStudio

Salesforce OmniStudio is a tool to build digital customer experiences tailored to any industry and can deliver automation for any business use case with its No-Code and Low-Code features. It provides automation with No-Code Low-Code feature only with configuration.

Automation with No-Code Low-Code feature of Salesforce OmniStudio

Salesforce OmniStudio is a great tool to create guided interactions that integrate into any industry-specific process. Admins can easily develop guided user experiences without code.

In that process, by only dragging components, the admin can integrate a component with external data. Imagine a developer or administrator consuming external system data in no time and a scalable manner without writing any code.

Show that data from Salesforce or external sources in a contextual screen for a full view of relevant data in a single place.

Why use OmniStudio

A Low Code No Code Platform enables customers to create guided brand experiences specific to their industry with clicks.

Drag-and-drop configuration capabilities

Effortlessly meet the demands of omnichannel service by deploying and updating these interactions across multiple devices and channels.

OmniStudio is part of Einstein Automate, which integrates Salesforce automation capabilities across Platform, Einstein, MuleSoft, Industries, and AppExchange to deliver an efficient end-to-end workflow platform.

Advantages of Omni Studio

  • Build a guided user flow that is highly customizable by configuration – The power of OmniScripts
  • Build customizable UI to show relevant data in a single screen from multiple data sources just by using clicked-based elements – Flexcards
  • Declarative ETL tool that extracts, transforms and loads data in Salesforce without writing code; operates behind the OmniScripts and Flexcards – DataRaptors
  • Declarative way to retrieve data from Salesforce/third-party services without any additional user interaction; run server-side for greater performance – Integration Procedures

Components of OmniStudio

FlexCards: Cards that display contextual information and actions in an at-a-glance format for a customer. A Datasource Wizard populates a FlexCard with data from one or more sources via point-click integration.

OmniScripts: A guided path to complete a business process. It’s a Modular Architecture in nature. A developer can integrate data from multiple sources (Salesforce or third-party), manipulate it, and send it back to its source, all from within the OmniScript. The data is captured in the standard JSON format.

OmniScripts has a great feature to dynamically generate documents from templates (MS Word, PDF, and HTML outputs), merge data from any data source, and then create and operate on these documents, like attaching them to Salesforce records and emailing them to recipients, plus delegate to DocuSign for eSignatures.

DataRaptors: Configurable services for retrieving, transforming, and updating data. A DataRaptor mapping tool enables you to read, transform, and write Salesforce data. There are four types of DataRaptor: Turbo Extract, Extract, Load, and Transform.

Integration Procedures: Declarative features and server-side processes that execute multiple actions in a single service call. An Integration Procedure is also recommended when you need fast processing of complex data from multiple sources. Server-side processing enables faster performance since, in most cases, the server is faster than the client at processing data. Combining multiple actions in a single server call prevents round trips to the server. Minimizing client/server calls is beneficial, as more round trips mean slower performance.

DataRaptors and Integration Procedures deliver data to and from UI components. They orchestrate calls to Apex classes, calculation engines, and external application programming interfaces (APIs) to execute whatever business logic is required.

Salesforce Omni Studio

Omni Scripts Vs Screen Flow: When to Use What

How to get an Omni Studio Developer Org

Signup for a Developer Edition org that has OmniStudio pre-installed. The org has all the data you need for hands-on practice in the OmniStudio Trailhead modules. This special org has a 180-day license

https://trailhead.salesforce.com/promo/orgs/omnistudiotrails

OmniStudio License

OmniStudio is included with specific Industries subscriptions: Financial Service, Health Cloud, Manufacturing, and Vlocity Clouds(Communications, Media, Energy and utilities, Public Sector, and Insurance)

Stay tuned for Omni Out

Explore more at https://twirltech.in/architect-blogs/

Hyperforce Salesforce

Salesforce has recently released Hyperforce to host the Salesforce App in a public server of your choice. Hyperforce is an entirely new infrastructure architecture that unifies the foundations of the various clouds and allows Salesforce to scale rapidly and securely using Public Cloud Partners, including Microsoft Azure, Amazon Web Services, and Google Cloud Platform.

Hyperforce is currently available in India, Australia, Canada, Japan, Singapore, Germany, France, and Brazil for Salesforce Core Services (“Core”). Customer 360 Audiences (CDP) is live on Hyperforce in the US and Germany

https://www.salesforce.com/in/products/platform/hyperforce/

Need for Hyperforce:

Countries like China, Russia, and others have strict data policies. Many Countries impose laws on what data can be hosted outside their borders and what data can’t go outside the country. In those customer requirements, Hyperforce comes to the rescue and supports local data storage, meaning customer data will not be transferred outside that country. Hyperforce means that data is stored at rest in the country. Data can be transmitted out of the country through standard interfaces.

Hyper-scalable: Implement faster with a super flexible infrastructure, Protect sensitive data
with the built-in trust of Salesforce.

Hyperforce Salesforce
Run your business from anywhere with the world’s most trusted public cloud

Hyperforce uses modern, cloud-based technologies that require you to adopt technical best practices in order to maintain connectivity with Salesforce. On Hyperforce, there are mandatory best practices:

  • Don’t use hard-coded instance references
  • Don’t use hard-coded IP allowlists.
  • Use HTTP1.1 or higher to call Salesforce API endpoints
  • Include a Service Name Indicator (SNI) in your TLS ClientHello message when connecting to a Salesforce service

What products are currently available on Hyperforce?

  • Core Salesforce Services (the services branded as Sales Cloud, Service Cloud, Experience Cloud, Chatter, and Lightning Platform)
  • Tableau CRM (including Einstein Discovery), Consumer Goods Cloud, Manufacturing Cloud, Service Cloud Voice
  • Customer 360 Audiences (CDP)
  • Managed packages branded as Salesforce CPQ and Salesforce Billing (together formerly branded as Salesforce Quote-to-Cash), Health Cloud, Financial Services Cloud, Sustainability Cloud, Salesforce Maps, and the Field Service managed package (“FSMP”), which is a feature of Service Cloud

Licensing
Currently, there is no cost for applications to run on Hyperforce.

Hyperforce Assistant: Salesforce provides tools and assistance to migrate the current Salesforce Org to Hyperforce. Salesforce provides Org Readiness Check; very similar to Lightning Migration Readiness Check to perform Hyperforce Specific Checks like

  1. Hard coded URLs
  2. IP Allowlist
  3. HTTP 1.0

During the plan migration, the existing Salesforce Org will be made read-only.

Hyperforce Assistant – Product Experience

Find more at https://twirltech.in/architect-blogs/

Deliver Great Patient Care with Salesforce Health Cloud

Salesforce Health Cloud Solution is a Customer Relation Management system that allows users and healthcare staff to access all patient information including medical history and upcoming health check-up appointments in real-time to Deliver Great Patient Care with Salesforce Health Cloud.

Four Major wings connect the healthcare system of an organization

PROVIDERS

•360-degree view of patient  data

•Complete patient experience & Real-time patient coordination and engagement

PAYERS

•Member care management & member journey

•Personalized member services

MEDTECH

•Manage commercial processes, build provider relationships, and engage with patients in a more efficient, compliant, and personal way.

PHARMA

•Deliver personalized patient and provider engagement and support programs while accelerating R&D innovation on a connected platform.

Deliver Great Patient Care with Salesforce Health Cloud
Salesforce Health Cloud

There are two Salesforce Health Cloud Licenses

Health Cloud Enterprise – Out-of-the-box CRM for healthcare and life sciences

Health Cloud Unlimited – Unlimited CRM power and support for healthcare and life sciences.

Use the below document to select right Health Cloud Edition for your business

Health Cloud provides:

  1. A Complete View of the Patient: Comprehensive patient care timeline with
    integrated EMR and device data
  2. Smarter Patient Management: Engage with patients and the entire care team in
    real-time
  3. Proactive Patient Engagement: Allow patients to manage personal healthcare
    goals and access complete care team
Deliver Great Patient Care with Salesforce Health Cloud

Salesforce Console – Allows healthcare professionals to Manage patients with ease
• Segment patients into useful lists based on various criteria in the population
• Track tasks and issues
• Create and execute care plans in the context of the patient’s full picture
o View more than just the patient – Complete care timeline and patient card view
o Facilitate collaboration
• Collaborate with patient teams within the organization
• Coordinate with family caregivers and unaffiliated health
professionals through communities

Deliver Great Patient Care with Salesforce Health Cloud
Health Cloud Console

Salesforce Patient Communities- Allows patients to:

  • Stay on top of health care goals
  • Access to the care plan
  • Reminders and tasks
  • Completion of surveys and forms
  • Easy collaboration with the entire care network
  • Find answers to questions quickly with Knowledge & search
  • Mobile access anytime, anywhere

Salesforce Health Cloud will also bundle Salesforce Shield to achieve HIPAA-compliant use of the product.

Salesforce complies with HIPAA in its capacity as a business associate. Salesforce Health Cloud also includes specific functionality to help customers achieve HIPAA-compliant use of the platform in their role as a covered entity. This includes a robust set of security, privacy, monitoring, logging, and encryption tools through Salesforce Shield to make it safe to store and operate on PHI in Salesforce Health Cloud.

Please find here the health cloud developer guide https://developer.salesforce.com/docs/atlas.en-us.238.0.health_cloud_object_reference.meta/health_cloud_object_reference/object_ref_overview.htm

For more blogs explore Architect Blogs – Twirl World (twirltech.in)

Slack Integration with Salesforce

An architect can design Slack Integration with Salesforce in 3 ways:

  1. Salesforce provides a free AppExchange manage package by which a developer can seamlessly automate the bidirectional integration between Slack and Salesforce
  2. There are Slack Apps like Rattle, Troops that provide Salesforce integration capability from the third party. Also, explore Apps in the Slack App directory for other kinds of integration capability
  3. Build your own integration in Salesforce using Slack Webhook
Slack and Salesforce Integration
Slack and Salesforce
  1. Salesforce for Slack: An AppExchange App by Salesforce to seamlessly send Salesforce records to a Slack channel. Trailhead provides a robust hands-on module on this https://trailhead.salesforce.com/content/learn/projects/integrate-salesforce-with-slack/install-salesforce-for-slack-and-grant-permissions
  2. Slack Apps by Third Party: There are many Third party apps to achieve Salesforce integration, few are even free.
    1. Troops is a very interesting App, update Salesforce record directly from Slack. It automates many Slack workflows. Troops is now a Salesforce company. https://www.troops.ai/
    2. Rattle provides robust Salesforce and Slack integration capability, it’s a license-based product. https://www.gorattle.com/
  3. A developer can build its own integration in Salesforce using Slack API and Webhook. below are high-level steps:
    1. Create an Incoming WebHook in the Slack workspace
    2. Whitelist the Webhook URL in Salesforce Remote Site Setting
    3. Build an APEX class with an Invocable method to call the webhook URL and send the Slack Request. Make use of JSON Generator class to serialize the JSON with standard encoding https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_JsonGenerator.htm Also make use of Slack message formatting documentation to format the text for app surfaces https://api.slack.com/reference/surfaces/formatting.
    4. That invocable method now can be called from a Flow or APEX.

Contact – Twirl World (twirltech.in)

Salesforce Social Customer Service

Turn social network posts into cases or leads with Social Customer Service. Service Agents can reply to social network posts from the Service Console. Salesforce Social Customer Service capability is delivered by Marketing Cloud Social Studio which is integrated with Salesforce Platform seamlessly.

Channels supported as of now:

  1. Facebook
  2. Twitter
  3. Instagram
  4. YouTube

There are two solutions to implement Social Customer Service, Basically, both are delivered by MC Social Studio.

  1. Social Customer Service Starter Pack: Comes with Service Cloud License, General limits are:
    1. Two or fewer social accounts can be tracked. So f you add one Twitter account, you can only add another Twitter account or one Facebook account
    2. No moderation rule, all posts become cases
    3. Instagram and YouTube aren’t available
    4. Can’t customize the default Apex code. The default Apex class creates a social post, social persona, case, and contact, and supports common use cases which can be customizable if you have Social Studio accounts
  • Social Studio accounts Marketing Cloud Social Studio implementation. Connector in Service cloud to integrate with MC Social Studio.

The features are:

  • Create Cases or leads from Social network posts and Assignment Rule to assign the cases to agents
  • Agents can directly respond back to customers to the Social Channels from the Service Console
  • Inbound and outbound social posts appear in case histories
  • Track customer sentiments and keywords” and help agents offer to take public conversations private
  • Send service requests directly to the Service Console, where agents can switch the conversations to the best channels for customers at any time.
  • Bring sales, service, and marketing teams together on social platforms to collaborate on the customer experience

Does the customer wants a few specific agents who are assigned to handle social posts from customers:

Admin can control the access via the permission set and profile permissions to access the social accounts.

If there is a governance requirement to review and approve responses from agents to social posts before making them public:

Admin can create an approval process for social services in which to assign service managers or marketers. Enable approvals for social posts in Social Customer Service Setup.

Can the agent share a file to the posts on social platforms for customers:

Send the attachment/file link to the post. Give the Run Apex As User in Social Customer Service Setup permission to Create Public Links.

Does the customer wants to moderate and triage incoming posts and only create cases for posts that have actionable requests:

Not available in the Social Customer Service Starter Pack. Social Studio account and its Social Studio Automate rule to turn off automatic case creation and enable moderation.

Salesforce Social Customer Service
Salesforce Social Customer Service

Read more at https://help.salesforce.com/s/articleView?id=sf.social_customer_service_overview.htm&type=5

https://twirltech.in/architect-blogs/

Render Google Map in Salesforce LWC

To render Google Map in Salesforce LWC we have a couple of options, let’s discuss those first:

  • MAP Base Component in LWC

Out of the Box in Salesforce, no need for additional Google MAP API; Only Plots the traverse points in the map, no route information

https://developer.salesforce.com/docs/component-library/bundle/lightning-map/documentation

Render Google Map in Salesforce LWC
  • Google MAP API implementation ONLY in LWC

Technically, this is not possible at this moment due to Security with Lightning Locker Services which prevents to run a script from a different domain/CDN

  • Google MAP API implementation with LWC + VF

The only possible design currently is placing a VF inside an LWC to render the Google Map and show the route. All logic is inside the LWC- VF is only for rendering

Render Google Map in Salesforce LWC
  • Buy Field Service Lighting or SALESFORCE MAPS licenses

We will only discuss the Google MAP API implementation with LWC + VF solution in this block. This is the only possible solution that needs customization in LWC, VF and APEX.

Prerequisite: Google MAP API License key for commercial use

The solution and Implementation steps are:

  1. A Quick Action to add a Lightning LWC Button to a page layout to access google form.
  2. Clicking on the button will open an LWC Component, LWC component will get the current record id and will call the apex controller to get the data.
  3. Get all required field information from the Apex controller class.
  4. Pass the Information info to the VF page to render the Google Map.
  5. Google Map is dynamically rendered based on the JSON input received from the LWC component.
  • It has one iframe to host the VF page that will render the Google Map by using the google map javascript library.
    • This solution has one unique challenge – to communicate data from the LWC component to the VF page and from the VF page to send the data to the Google Javascript library. All event sequences need to be followed properly.
    • LWC component will read data from the salesforce object and send the location data to google Map.
  • It plots all the locations to Map with the route.
  • The right-hand side panel shows the distance between each point. All Data is dynamically populated from google maps.
Render Google Map in Salesforce LWC

VF code to render Google MAP

<apex:page showHeader="false" >
    <apex:includeLightning />
    <div id="rcontainer">
    </div>   
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
        <title>Google Maps API v3 Directions Example</title>
        <script type="text/javascript" src="//maps.google.com/maps/api/js?key=GOOGLE API KEY"></script>
    </head>
    
    <body style="font-family: Arial; font-size: 12px;">
        
        
         <script >
                
            /*** EventListener to GET response from LWC  ***/
                   /*** EventListener to GET response from LWC  ***/
window.addEventListener("message", function(event) {
    var directionsService = new google.maps.DirectionsService();
    var directionsDisplay = new google.maps.DirectionsRenderer();
    
    var map = new google.maps.Map(document.getElementById('map'), {
            zoom:7,
            mapTypeId: google.maps.MapTypeId.ROADMAP,
        	mapTypeControl: true,
        disableDefaultUI: false,
        

    });
    directionsDisplay.setMap(map);

    directionsDisplay.setPanel(document.getElementById('panel'));
    console.log('vf page data'+event.data);
    var request = {
        origin: '',
        destination: '',
        waypoints: [],   
        travelMode: google.maps.DirectionsTravelMode.DRIVING
    };
        console.log('request1'+request);
    let counter=0;
    for (let i = 0; i < event.data.length; i++) {
        console.log('Check_In_Location__Latitude__s'+event.data[i].Check_In_Location__Latitude__s);
         console.log('Check_In_Location__Longitude__s'+event.data[i].Check_In_Location__Longitude__s);
        if(i==0){
            var StartLocationA = new google.maps.LatLng(event.data[i].Check_In_Location__Latitude__s, event.data[0].Check_In_Location__Longitude__s);
            request.origin=StartLocationA;
            console.log('request2'+request);
        }
        else if(i==event.data.length-1){
            var EndLocationB = new google.maps.LatLng(event.data[i].Check_In_Location__Latitude__s, event.data[0].Check_In_Location__Longitude__s);
            request.destination=EndLocationB;
            console.log('request3'+request);
        }
        else{
            
            var StopOver1 = new google.maps.LatLng(event.data[i].Check_In_Location__Latitude__s, event.data[0].Check_In_Location__Longitude__s);
            var waypointjson={
                          location: StopOver1,
                          stopover: true,
                        };
            request.waypoints[counter]=waypointjson;
            counter++;
            console.log('request4'+request);
        }
    }
    
    
    directionsService.route(request, function(response, status) {
        if (status == google.maps.DirectionsStatus.OK) {
            directionsDisplay.setDirections(response);
           	hideDetail();
            
        }
    });
});
        //This is a POC code, Loading div needs to implemented for actual implementation
        function hideDetail() {
  			
            setTimeout(
    			function() {
      				for (let i = 0; i < document.getElementsByClassName('adp-directions').length; i++) {
  						document.getElementsByClassName('adp-directions')[i].style.display='None';
					}
    			}, 100);
            setTimeout(
    			function() {
      				for (let i = 0; i < document.getElementsByClassName('adp-directions').length; i++) {
  						document.getElementsByClassName('adp-directions')[i].style.display='None';
					}
    			}, 500);
            setTimeout(
    			function() {
      				for (let i = 0; i < document.getElementsByClassName('adp-directions').length; i++) {
  						document.getElementsByClassName('adp-directions')[i].style.display='None';
					}
    			}, 1000);
			}
        
             const contentString =     				;

  			const infowindow = new google.maps.InfoWindow({
    			content: contentString,
  			});

        </script>
    </body>
</apex:page>

https://twirltech.in/