Wednesday, 31 July 2024

Scratch Org Snapshot (Summer 24 GA)

 A snapshot captures the state of a scratch org at a point in time. To update your snapshot, delete it 

and create another snapshot. Unlike an org shape, a snapshot includes installed packages, metadata, and data. 

The time to create a snapshot depends on the size of the source scratch org. To speed up snapshot creation time, 

include only what’s necessary for your project.


A snapshot is a point-in-time copy of a scratch org that includes installed packages, features, limits, licenses, metadata, and data.

 

With scratch org snapshots, you can quickly replicate scratch orgs with the required project dependencies.


3.Create Scratch Org using Definition File


sf org create scratch --definition-file Config/snapshot-scratch-def.json --alias your-scratch-org-alias --target-dev-hub your-dev-hub-alias --wait 10


ex :


sf org create scratch --definition-file config/project-scratch-def-snapshot.json --alias SnappedScratchOrg --target-dev-hub Spring24 --wait 10


The definition file look like below


project-scratch-def.json 

{

"orgName" : "Demo Scratch Org from a Snapshot,

"snapshot" : "Mysnapshot"

}


Create Scratch snapshot using cli command



sf org create snapshot --name <name> --source-org <ID or alias of scratch org> \

--target-dev-hub <username or alias of Dev Hub org> --description <text>


ex :


sf org create snapshot --name dhsnapshot --source-org dreamhouse-scratch \

--target-dev-hub my-dev-hub --description "Dreamhouse app"



Scratch org Snapshot CLI commands


1.Create : org create snapshot

2.List   : org list snapshot

3.Delete : org delete snapshot

4.Get    : org get snapshot


Key features of scratch Org snapshots :

CLI commands to create,list and delete snapshots

Support for Salesforce,Platform and DX Limited Access user Licenses

Allocations per edition : 40 in Enterprise,100 in Unlimited and performance

Max 90 day lifespan

Auto-cleanup of expired snapshots

Auto-upgrade of snapshot version at major salesforce release boundaries

Compatible with package version creations.


Sunday, 21 July 2024

Event Delegation in LWC

 Event delegation is a pattern in javascript where a single event listener is added to a parent element

to manage events for its child elements.Instead of adding event listeners to each individual child elements,

event delegation takes advantage of event bubbling,which allows the parent element to handle events for its descendants.


In LWC, event delegation can simplify code,improve performance and reduce memory consumption by minimizing the number of event listeners.


ex :


<template>

<div class="contact-list" onclick={handleContactClick}>

 <template lwc:if={contacts.data}>

     <template for:each={contacts.data} for:item="contact">

        <div key={contact.Id} data-id={contact.Id} class="contact-item">

{contact.Name}

</div>

     </template>

</template>

</div>

</template>


export default class ContactList extends LightningElement {

    @wire(getContactList) contacts;


    handleContactClick(event) {

        // 1. Identify the target element that triggered the event

        const target =event.target;

        // 2. Check if the target is a contact item

        if(target.classList.contains('contact-item')){

   // 3. Retrieve the Contact id from the target

   const contactId=target.dataset.id;

   // 4. Perform the described action with the contact id

    }

}


Note :

Utilize event delegation to minimize the number of event listeners in your application.

By setting a single listener on a parent element and checking the event. target property, you can handle events from multiple child elements efficiently.


Friday, 19 July 2024

Salesforce marketing cloud : Getting Started

 Salesforce marketing cloud Editions :


1.Basic

2.Pro

3.Coporate

4.Enterprise


Basic enables you to execute email marketing with data from Sales Cloud.

Pro is very similar to Basic plus automation Studio.

Corporate is where you're enabled to use Marketing Cloud's multi-channel capabilities through SMS and push, tying them together with Journey Builder.

Enterprise have the full capabilities of Marketing Cloud to scale your enterprise business.


cost-affecting items of Marketing Cloud :


 The key factors of cost drivers of Marketing Cloud.

 

1.Editions

2.Super Messages

3.Add-ons


Editions is one of the key factors of cost drivers of Marketing Cloud, and we'll provide you the capabilities of what you can do within the platform.


Super Messages are how you communicate with your customers.

(or)

Any type of customer facing message or experiences that comes from Marketing Cloud.

The number of Super Messages consumed per message varies by type of message


Add-ons can either include add-on functionality to your edition or purchased AppExchange products through the AppExchange to extend Marketing Cloud functionality.



Marketing Automation :


Marketing automation is technology that manages marketing processes and multifuctional campaigns,across multiple channels,automatically.


What does Marketing Automation do ?


Messaging  : Communication across multiple channels.

Automation : Automate when and what channel you send messages.


Studio & Builders :


Within Marketing Cloud, there are two different types of apps, studios and builders.


Studios are the apps that enable you to create messaging that your customers interact with.

Builders are the apps used to build the piping, automation, and track how everything is performing.


Email Studio :

Email Studio is used to develop email templates, messaging, and personalization that can send your customers.

Mobile Studio :

which is where you can build and send SMS and push notifications and chat app messages across your channels.

Interaction Studio :

which enables real-time orchestration of content across channels and also provides next best actions to customers.

Social Studio : 

Social Studio is a listening, publish, and engaging platform that enables you to manage your social media accounts such as Facebook and Twitter.

Advertising Studio :

Advertising Studio uses your first-party data to securely build a one-to-one advertising campaign across multiple social channels such as Google, Facebook, LinkedIn, Twitter, and Pinterest.

Automation Studio :

Automation Studio, which is where you're able to build the automation of your messaging to your customers across multiple channels.


Journey Builder :

Journey Builder is where you pull all of this cross-channel communication and messaging together, so that you can orchestrate the lifecycle of a customer's experience.

Analytics Builder :

Analytics Builder, which is used to track how those communications are performing and gain insights into how your customers are behaving.

Contact Builder :

Contact Builder is the ability to store data from multiple sources and stitch it together, and it is the app that is used to segment and personalize your data.

Datorama :

Datorama, which is a cross‑platform marketing intelligence tool.

Content Builder :

Content Builder, which is where you store your assets, develop your email communication, and develop your templates to scale across all of your communication.


Marketing Cloud Foundational Elements :


1.Business Unit :

Business units are a way to control how information is shared across Marketing Cloud. 

This provides you the ability to manage data control and brand separation inside of your single instance of Marketing Cloud.


Note :  Before creating new business units, you map out the intended structure based on your organization.


2.Roles 

Allows you to manage what people can view,create,edit and delete.

Custom roles can be created.


3.Sender Reputation


Sender Authentication Package (SAP)

IP Address

Domain


Prior to sending any communications though, you need to set up your sender authentication package, which is a package that pulls together your IP address in your domains.

The sender authentication package is made up of two big elements, IPs and domains.


Each instance has an IP address. 

It's most common to have a dedicated IP address, but in some cases you may have a shared one with a few other accounts depending on your limited volume. 

On the other side, you have domains, which will be used to link what will be shown in your emails in the landing pages and images to your brand and your SAP package.


4.Data


--> sources

This is where the data is stored in Marketing Cloud.

a.Data Extensions

b.Lists

 In most cases you'll be utilizing data extensions which are a flexible way to store small and large data that can either be your customers directly or information about them.

--> Inputs

a.FTP

b.Integrations

Inputs are how the data gets into Marketing Cloud, this typically includes out-of-the-box integrations with Sales Cloud,

but can also include APIs and FTP integrations to bring new data into Marketing Cloud. 


--> Automations 

a.Queries

b.Filters

Once you have your data in Marketing Cloud, you typically need to transform or segment it in some way to get to the right audience, that's where queries and filters come into the picture.


Security Categories :


--> Logins

Time outs,SSO,Authenticated apps

--> Data

Data Encryption,business units,access

--> Landing Pages

Secure display and capture of data from the web.


Roles :

-->Marketing manager

This person is responsible for directing the team where they're going to be heading and bringing the requirements to the table to define what is being built in Marketing Cloud.

-->Marketing Cloud architect

Marketing Cloud architect who is responsible in finding how the overall solution will be constructed based on the business requirements. Key activities include defining how data will be used in the platform, building for scale, and ensuring the proper use of platforms, and so much more.

-->Content Manager

Generally, the Content Manager is responsible for asset creation and will bring the email from concept to life.

-->Data and analytics analyst

Data and analytics analyst will work in tandem with the Content Manager to build up the necessary filters, transformations, and ensure the company is sending to the right audience.

-->Marketing Cloud Developer

This role is critical as you begin to mature your communication and begin to bring personalization that will require AMPscript into life.


Governance Models :

For marketing automation, I've seen three typical models that have been developed in order to really provide the scale you need for your instance.

-->Hub & Spoke

Centrailzed methodology across the company,but distributed resources.

-->Centrailzed

Centrailzed resources,providing content for the entire company.

-->Multi Hub & Spoke

Large scale distribution for highly complex business.


Common Compliance Regulations :


CAN-Spam

CASL

GDPR

others


Each of these have different regions and focus and have different requirements for the regulations, so it's important as you're thinking about your foundation for Marketing Cloud that you understand what regulations you need to support.


Saturday, 13 July 2024

Salesforce Devops Tools

 Salesforce DevOps tools are specialized tools designed to facilitate continuous integration, continuous delivery (CI/CD), and automated deployment for Salesforce applications. These tools help streamline development processes, improve code quality, and enable faster and more reliable releases. Some popular Salesforce DevOps tools include:


Salesforce DevOps Center : Salesforce DevOps Center aims to bridge the gap between development and operations, enabling teams to deliver high-quality applications more efficiently and with greater confidence. It is especially useful for organizations that are adopting DevOps practices and looking to streamline their Salesforce development workflows


Copado A comprehensive DevOps solution that offers features like version control, automated deployments, continuous integration, and testing specifically tailored for Salesforce.


Gearset A powerful tool for Salesforce DevOps that provides continuous integration, deployment automation, and robust backup solutions. It simplifies the process of comparing and deploying changes between Salesforce orgs.


AutoRABIT An end-to-end Salesforce DevOps platform that includes features like continuous integration, continuous delivery, version control, and automated data deployment.


Flosum A native Salesforce DevOps solution that provides version control, continuous integration, automated deployments, and release management, all within the Salesforce ecosystem.


Copado Essentials (formerly ClickDeploy): A user-friendly tool that offers deployment automation, version control, and change tracking for Salesforce admins and developers.


Salesforce DX: A set of tools and features provided by Salesforce to enable modern development practices, including the Salesforce CLI, scratch orgs, and a more efficient way to manage and deploy metadata.


Jenkins: While not Salesforce-specific, Jenkins can be integrated with Salesforce to create CI/CD pipelines, automate deployments, and manage version control.


SFDX-CLI: The Salesforce DX Command-Line Interface, which allows developers to script and automate many Salesforce development and deployment tasks.


These tools help Salesforce development teams to automate repetitive tasks, ensure code quality, and speed up the deployment process, leading to more efficient and reliable software development cycles.


Tuesday, 9 July 2024

Prompt Builder

 Prompt Builder takes all the power of LLMs and combines it with your Salesforce data. 

You can use it to help you write personalized emails to customers, build out records with more information, and much, much more.

Four prompt template types:

1.Sales Email Template :

The sales email template drafts an email you need to send to your customer. Some examples include introducing them to a new product, or reminding them about an appointment.

2.Field Generation Template :

With the field generation template, you can quickly and easily populate or complete a specific field on a record page with a summary or description created by an LLM.

3.Record Summary Template :

The record summary template does exactly what it says it does: summarizes a record. This one is really easy to use via Einstein Copilot, and his clients love it for meeting prep.

4.Flex Prompt Template :

Finally, there’s the flex prompt template. This can be used anywhere and everywhere on the platform to create a customized prompt template that incorporates records from multiple objects simultaneously. An example would be to create a personalized product recommendation for a customer based on an Einstein Next Best Action.


Flex prompt templates, they are really powerful and versatile because what they allow an admin to do is to connect up to five objects together

in a prompt template for the purposes of grounding. Those five objects could be standard objects or custom objects. 

They don’t have to be related to each other in any way, shape or form, but through the power of the UI that the 

admin is surfacing, they can ground the flex prompt templates with each of those different objects with the expectation of getting a response from the LLM.


Note :

With all of these prompt templates, you can dynamically ground them with data from Salesforce or Data Cloud. That gives the LLM the power to pull data from records or, with flows, from pretty much any object—standard or custom—in your Salesforce org.


Monday, 8 July 2024

CPU time limit and Heap Size issues in Salesforce

 CPU time limit and Heap Size issues are two of the notorious governor limits.


How do you debug and figure out where exactly the CPU time or heap size is consumed?


Use limit statements in your code 


Limits. getHeapSize() and Limits.getCPUTime()


Add these statements in multiple places to debug the flow and figure out where exactly the time or heap size is consumed.

Retrieval augmented generation (RAG)

 Retrieval augmented generation (RAG) combines your company data with AI, turning generic chatbots into powerful tools that know your business inside out. 


1.An AI technique that enhances large language model (LLM) outputs by retrieving and incorporating relevant proprietary data into prompts.

2.A process that combines LLMs with vector database to pull and utilize both structure and unstructured data in generating responses.

3.A method that helps reduce AI hallucinations by grounding responses in trusted, company-specific information.



Sunday, 7 July 2024

Salesforce CPQ

 What is CPQ?

 CPQ stands for Configure,price,Quote.

 It's a managed package built by Steelbrick in 2010 and 

 acquired by Salesforce in 2015.

 

 The main reason our customers choose a tool like CPQ is SCALABILITY.

 

 --> 10 times faster quote generation.

 --> 95% reduction in approval time.

 --> 2x faster moving from quote to cash.

 --> 30% quicker ramp for new reps.

 

 Benefits with CPQ :

 1.Sell products in bundles > Increased Revenue

 2.Automated volume pricing and discounting > Increased Revenue

 3.Streamline Approvals > Avoid Bottlenecks

 4.Standardize output documents > Increased Customer Satisfaction

 



High Level CPQ Architectural Design 


1. CPQ uses some standard objects : Opportunity,Product,Order,Contract,

    Assert; and lot of custom objects : Quote , Subscription etc.

2. CPQ Configuration is made up of records stored in custom objects.

    Eg. Bundles are made up of products,Product Options,Features etc.

3. CPQ calculates pricing according to CPQ's price Waterfall - this is a predefined order

 in which different types of discounts are applied to get to the net price which is shown 

 to the customer

 

CPQ License Types :


Salesforce CPQ

Salesforce CPQ+

Salesforce CPQ+Billing 

Salesforce CPQ for Partner Communities

Salesforce CPQ for Customer Communities