Tuesday, 31 December 2024

pause and resume scheduled jobs programmatically

 Salesforce Spring ’25 release, 

Apex developers can now pause and resume scheduled jobs programmatically! 


This highly anticipated feature enhances job management, offering more flexibility in handling scheduled tasks.


How It Works:

 1. Pause Scheduled Jobs:

Use the System.pauseScheduledJob(jobId) method to temporarily halt a scheduled job.

 2. Resume Scheduled Jobs:

Resume the paused jobs using System.resumeScheduledJob(jobId) without needing to delete or reschedule.


Key Benefits:

 • Improved Control: Manage job execution more effectively during maintenance or troubleshooting.

 • Increased Flexibility: Avoid manual rescheduling by pausing and resuming jobs as needed.

 • Streamlined Maintenance: Ensure system performance by pausing non-critical jobs during peak times.


This update is especially useful for admins and developers managing high-volume or critical environments. It eliminates the need to delete and recreate jobs, saving time and effort.


Here’s how you can pause and resume scheduled jobs using Apex in Salesforce:


Example Code:


// Get the ID of a scheduled job

String jobId = 'YOUR_JOB_ID_HERE'; // Replace with the actual job ID


try {

 // Pause the scheduled job

 System.pauseScheduledJob(jobId);

 System.debug('Scheduled job paused successfully.');

 

 // Resume the scheduled job

 System.resumeScheduledJob(jobId);

 System.debug('Scheduled job resumed successfully.');

} catch (Exception e) {

 System.debug('Error: ' + e.getMessage());

}


Steps to Use:

 1. Replace YOUR_JOB_ID_HERE with the actual job ID, which you can find using System.scheduleJobs or by querying the CronTrigger object.

 2. Execute the code via the Developer Console or include it in your Apex class or trigger.


Notes:

 • Ensure the job is active before attempting to pause it.

 • Paused jobs can be resumed without needing to reschedule them, saving time during system maintenance or debugging.

 • Permissions: Verify that the user executing the code has appropriate permissions to manage scheduled jobs.


This new functionality simplifies scheduled job management, enhancing operational efficiency and flexibility!   


Sunday, 29 December 2024

Basics of Experience Cloud

 Salesforce Community Templates :


A Salesforce community template is essentially a starting point for a new community.

Standard templates are provided by Salesforce, and custom templates are available from partners.


four main elements in a community template:

1.Theme

2.Pages

3.Components

4.configuration

There's a theme, which provides the overall look and feel, the pages, the components that can go on those pages or are simply available for use, and finally, the configuration of those components that are on the pages.


Fundamental Elements of Community :


1.settings : Overall and Community-specific

2.Sharing & Visibility : Community data access

3.Topics & Chatter : Organized Collaboration

4.Knowledge : Curated articles for a Community

5.Personalization : Audience targeting specific items

6.CMS Content : News,images , documents etc.


some key org settings that impact communities:


These are located in various places within Setup. Some noteworthy settings include Chatter, Feed Tracking, Topics for Objects, and Knowledge.

 

Key Communities Settings:

Communities settings are available after initially enabling communities overall.

- Community Domain(required)

This sets the base domain for all of the communities in your org. 

It can be overwritten with a custom domain, but this is the standard approach for setting your community domain.

-Enable ExperienceBundle Metadata API

This allows you to take advantage of a text‑base representation of different settings in your community, such as pages, branding sets, and themes.

-Enable Partner Super User Access

which is very useful if you want to grant one or multiple users additional access in your org. This allows these users to access more data and records, regardless of sharing rules and organization‑wide defaults.

-Allow using standard external profiles for self‑registration and user creation.

-Enable Account Relationships

which allows sharing between partner accounts.


Community-specific settings :

-main settings

which control the name and URL of the domain

-Preferences

-Members & Contributors

-Login & REgistration

-Emails

-Pages


Sharing & Visibility :

Data security must be considered a top priority within any community.


Community Data Security Elements 

1.Object & Field Access

2.Organization-wide Defaults Sharing

3.Record Sharing

4.Sharing Sets

5.Share Groups

6.Account Relationships


Community Membership

can you access the community?

Object Permissions

Can you access the object?

Field Permissions

Can you access the fields?

Sharing/Visibility

Can you access specific records of this object?


Object and Field Access :

Access is granted to users through profiles or permission sets.

Organization-wide Default Sharing Settings :

Organization-wide default(OWD) sharing determines record visibility,by default.

Four primary settings for OWD sharing are 

- Private

- public Read only

- Public Read/Write

- Controlled by parent

Internal and external defaults can differ, eternal cannot be more open than internal.


Record Sharing :

Builds on OWD sharing settings

Granular record sharing can be facilitated in various ways:

- Manual

- sharing rules

- Apex sharing

Record sharing can only be applied to external users with specific licenses:

-partner Community

- customer community plus


Sharing Sets :

Sharing Sets are Unique to communities.

Can be used for sharing with users of any external license type (Partner/customer)

Applicable to objects with an OWD sharing setting of Private or Public Read Only.

Logic requires either a contact or account lookup on shared item and user sharee.

Sharing Sets are not community-specific,but instead map to profiles.


Share Groups :

Share Groups share the data of HVP users whose profile is included in a Sharing Set.

The objects configured in the Sharing Set are ignored;all shared records are affected.

The users with whom data is shared can be identified by user,role or group.

The user with whom data is shared can be internal or partner users.


Account Relationship Sharing :

Allows for relationship-based sharing in a multi-level community.

Enables data associated with a "sub-partner" to be shared with a partner.

Streamlines the management of data visibility in a more complex community.


Topics in Communities :

Topics provide context and show relevance.

They serve as the glue between various elements within a Salesforce community.

Topics can e associated with various data types,including

- Knowledge articles

- some Standard and Custom objects

- Chatter posts

- Files

- Users (Knowledgeable Experts)


With Topics you can associate them with files,articles,chatter posts ,object records,and they connect that content and data with users.


Groups in communities:

These are a feature of Chatter, which is a feature that has been around on the Salesforce platform for quite a while.

 In communities, however, groups have high relevance as they enable contained conversation.

 These groups can be public, private, or unlisted, and all standard Chatter functionality is supported with some additional functionality available for groups.

 

Audience Targeting in communities:

Audience targeting allows for seamless personalization of web elements.

Audiences can be constructed with various data points,including :

-User record (including related data)

-User Profile

-Location (IP-based)

-Domain

Personalization supports advanced setup via API, but code is not required.


Audience Targeting Methods:

1.Page Variations

which allows you to show a completely different page to multiple audiences.

2.Components 

components, which allows you to focus on one or more components on a particular page; this is beneficial if you want subtle, small changes and not a completely different page for a user.

3.Branding Sets

controls the overall look and feel from multiple users.


CMS and Content for Communities:

Enables advanced authoring and management of content.

Allows content to be shared with multiple targets and managed centrally.

can be associated with topics within a community.

Community Cloud is one potential channel: content can be shared with other systems.


CMS Content Types

News

Image

Document


Workspaces and channels are also important aspects of CMS.

Workspaces essentially allow you to define channels and determine where the content from each workspace can be delivered.


CMS Connect in Communities :

A low-code option to consume content from outside content management systems.

Useful for organizations looking to keep an existing CMS but using Salesforce for communities.

Supports multiple layers of content for a seamless user experience; e.g. blog posts have their own detail pages.


CMS Presentation Control in Communities:

Separates data and presentation layers.

Enables admin-friendly configuration of front end user experience elements.

supports single-item and list display.


Experience Cloud License and membership

 Experience Cloud Authentication Groups:


1.Guest Users

Represents all unauthenticated users (i.e. the public)

2.External Users

Partners and customers : users that do not have a "standard" license.

3.Internal Users 

Employees and contractors : users with  a standard license.


Note :

Unauthenticated access to a Salesforce community does not require a license.This applies to Guest users.



Membership : Junction of the user and a community. And this grants a person access.


The keys to Community Membership :


A license is required for authenticated community membership.

A user profile associated with an appropriate license type must exist.

A user record must be created with an applicable user profile.

When a user profile is added to a community,all users with that profile are now licensed users of that community.


Permission Sets :

Granting an individual access to a community can be done via permission sets.

Allows maintenance of existing profiles without providing unnecessary access.

Permission Set access is used less often than granting access via user profiles.

This would typically be used as an exception, not the standard for access.


License Types and Capabilities :


1.Customer Community 

Customer community provide access to a few key standard objects,

such as accounts,contacts,cases,products and orders, upto 10 custom objects.

chatters, files and knowledge (read-only)


2.Customer community plus

Customer community plus takes everything that customer community has and adds a few key additions.

Additional Read/Write access to standard objects.

Reports and Dashboards

Roles

Advanced sharing

Additional Data Storage

Additional API Calls

Delegated Admin


3.Partner community

Partner license types provide everything that customer community plus has along with access to additional standard objects.

leads,opportunities

Also some additional data storage and territory management.


4.Commerce portals

Similar to Customer Community.

with less standard objects and more custom objects.


5.External Apps

it's similar to Partner,has more storage , API calls , custom objects(100).


6.Channel Account

Same as Partner, but billed per partner instead of per user.


upgrade paths between community licenses :


Quick & easy Upgrade path :


From Customer Community to either customer community plus or Partner community.

This upgrade is fairly straightforward.


Multi-step Upgrade path :


possible Upgrade between Customer Community Plus and Partner.however, it takes a little bit more work to make that happen.


To take a user who has a Customer Community Plus or a Partner license and move them to Customer Community 

requires a significant amount of work and is not a standard upgrade path.


Named User vs User Login Licenses :

A named user license, or simply user, is associated with a named, dedicated user record and is associated with all corresponding logins over time.

The user login license type is not named or dedicated to one person. It is associated with an instance of authenticated access.

 

The named user license type is acquired and is associated with an individual user. That user logs in. Let's say that user logged in four times in a month. The license count, however, will only be 1 because all 4 logins are associated with the named user.

The user login scenario is different. This user logs in 3 times in a month, and each of those is added to the total, which is 3. So a user with a user login license type that logs in 3 times uses 3 licenses in that month.

 

Note :

A fully optimized license allocation assumes a named user assignment for users that have 3+ logins/month.


Friday, 27 December 2024

How to Reset Salesforce Flow Limits

 How to Reset Salesforce Flow Limits That Cause Errors Like "Number of Iterations Exceeded" or "Apex CPU Time Limit Exceeded" 


The limits are reset when the flow transaction ends. To end the transaction, we can perform these steps :


1. Autolaunched Flows :

• Pause Element: Set to 0 hours to end the transaction and clear limits.


2. Screen Flows :

• Screen Element: Ends the transaction after displaying the screen.

• Local Action: Use an empty local action to end the transaction.


Use these methods to help prevent flow errors caused by governor limits !!

Service cloud omni-channel

 omni-channel channel types :


omni-channel is capable of working with two types of channels.

--> Real -Time Channels

--> Asynchronous Channels


Real - Time Channels :


Real-time Channels are channels where the person asking support is expecting a real-time answer to their request.


ex : Phone calls or live chat


Asynchronous Channels :


Asynchronous channels are channels where the person asking support is expecting a reply to their request at a later time.


ex : emails or contact forms


Omni-Channel Routing Destinations :


Omni-Channel can route Work Items to 3 different destinations.


1.Route to Queue


Work Items fall in a Queue of Users where Users are then picking up work first-in first-out.


2.Route to Skill


Work items are assigned to the Agents that have the proper Skills to work on the request.


3.Route to Agent 


work Items are assigned to a specific Agent directly.


Omni-Channel Agent Properties :


Agents have properties that Omni-Channel uses in order to select which agent is better suited to receive a work item based

on its Routing Destinations.


1.Status & Capacity :


Agents all have a Status, which models their availability,

and a Capacity, which models the maximum amount of work they can take.

ex : Statuses are : Away, Available,On Break etc

 

2.Skills :


Agents have a set of skills that they can leverage to take certain work Items.

Work Items can require one or multiple skills to be assigned. 

ex : Skills are : English, 2nd Tier,Robert Butler Maintenance etc


3.Queue Membership


Agents can e assigned to specific  queues,and thus work on work Items that fall in those Queues.

ex : Queues are : Billing,Complaint


Omni Supervisor :

Supervisors get access to the Omni Supervisor function in Omni-Channel in order to monitor their team easily.


1.Monitor Agents

2.Monitor Work Backlogs

3.Monitor Assigned Work


Monitor Agents :

Supervisors can monitor the Agents they have access to through the Supervisor Configuration assigned to them.

This include, the Agent status and status timeline, the Agent's Current work and open capacity, how long theyve been logged in etc.

Monitor Work Backlogs:

Supervisors can monitor specific skill & Queue backlogs to gauge how much work is left to be assigned to agents.

This allows them to have simple visibility on where to focus their efforts.

Monitor Assigned Work:

Supervisor can monitor work that's being worked on.

Using specific channel functionalities,they can even listen in on phone calls,

or see what agents are typing in the Chat even before they've sent it.

Wednesday, 25 December 2024

Different Git Commands

 𝟭. 𝗴𝗶𝘁 𝗱𝗶𝗳𝗳: Show file differences not yet staged.

𝟮. 𝗴𝗶𝘁 𝗰𝗼𝗺𝗺𝗶𝘁 -𝗮 -𝗺 "𝗰𝗼𝗺𝗺𝗶𝘁 𝗺𝗲𝘀𝘀𝗮𝗴𝗲": Commit all tracked changes with a message.

𝟯. 𝗴𝗶𝘁 𝘀𝘁𝗮𝘁𝘂𝘀: Show the state of your working directory.

𝟰. 𝗴𝗶𝘁 𝗮𝗱𝗱 𝗳𝗶𝗹𝗲_𝗽𝗮𝘁𝗵:Add file(s) to the staging area.

𝟱. 𝗴𝗶𝘁 𝗰𝗵𝗲𝗰𝗸𝗼𝘂𝘁 -𝗯 𝗯𝗿𝗮𝗻𝗰𝗵_𝗻𝗮𝗺𝗲: Create and switch to a new branch.

𝟲. 𝗴𝗶𝘁 𝗰𝗵𝗲𝗰𝗸𝗼𝘂𝘁 𝗯𝗿𝗮𝗻𝗰𝗵_𝗻𝗮𝗺𝗲: Switch to an existing branch.

𝟳. 𝗴𝗶𝘁 𝗰𝗼𝗺𝗺𝗶𝘁 --𝗮𝗺𝗲𝗻𝗱:Modify the last commit.

𝟴. 𝗴𝗶𝘁 𝗽𝘂𝘀𝗵 𝗼𝗿𝗶𝗴𝗶𝗻 𝗯𝗿𝗮𝗻𝗰𝗵_𝗻𝗮𝗺𝗲: Push a branch to a remote.

𝟵. 𝗴𝗶𝘁 𝗽𝘂𝗹𝗹: Fetch and merge remote changes.

𝟭𝟬. 𝗴𝗶𝘁 𝗿𝗲𝗯𝗮𝘀𝗲 -𝗶: Rebase interactively, rewrite commit history.

𝟭𝟭. 𝗴𝗶𝘁 𝗰𝗹𝗼𝗻𝗲: Create a local copy of a remote repo.

𝟭𝟮. 𝗴𝗶𝘁 𝗺𝗲𝗿𝗴𝗲: Merge branches together.

𝟭𝟯. 𝗴𝗶𝘁 𝗹𝗼𝗴 --𝘀𝘁𝗮𝘁: Show commit logs with stats.

𝟭𝟰. 𝗴𝗶𝘁 𝘀𝘁𝗮𝘀𝗵: Stash changes for later.

𝟭𝟱. 𝗴𝗶𝘁 𝘀𝘁𝗮𝘀𝗵 𝗽𝗼𝗽: Apply and remove stashed changes.

𝟭𝟲. 𝗴𝗶𝘁 𝘀𝗵𝗼𝘄 𝗰𝗼𝗺𝗺𝗶𝘁_𝗶𝗱: Show details about a commit.

𝟭𝟳. 𝗴𝗶𝘁 𝗿𝗲𝘀𝗲𝘁 𝗛𝗘𝗔𝗗~𝟭: Undo the last commit, preserving changes locally.

𝟭𝟴. 𝗴𝗶𝘁 𝗳𝗼𝗿𝗺𝗮𝘁-𝗽𝗮𝘁𝗰𝗵 -𝟭 𝗰𝗼𝗺𝗺𝗶𝘁_𝗶𝗱: Create a patch file for a specific commit.

𝟭𝟵. 𝗴𝗶𝘁 𝗮𝗽𝗽𝗹𝘆 𝗽𝗮𝘁𝗰𝗵_𝗳𝗶𝗹𝗲_𝗻𝗮𝗺𝗲: Apply changes from a patch file.

𝟮𝟬. 𝗴𝗶𝘁 𝗯𝗿𝗮𝗻𝗰𝗵 -𝗗 𝗯𝗿𝗮𝗻𝗰𝗵_𝗻𝗮𝗺𝗲: Delete a branch forcefully.

𝟮𝟭. 𝗴𝗶𝘁 𝗿𝗲𝘀𝗲𝘁: Undo commits by moving branch reference.

𝟮𝟮. 𝗴𝗶𝘁 𝗿𝗲𝘃𝗲𝗿𝘁: Undo commits by creating a new commit.

𝟮𝟯. 𝗴𝗶𝘁 𝗰𝗵𝗲𝗿𝗿𝘆-𝗽𝗶𝗰𝗸 𝗰𝗼𝗺𝗺𝗶𝘁_𝗶𝗱: Apply changes from a specific commit.

𝟮𝟰. 𝗴𝗶𝘁 𝗯𝗿𝗮𝗻𝗰𝗵: Lists branches.

𝟮𝟱. 𝗴𝗶𝘁 𝗿𝗲𝘀𝗲𝘁 --𝗵𝗮𝗿𝗱: Resets everything to a previous commit, erasing all uncommitted changes.

Different ways to validate and view data in Data cloud

 Data Explorer

Query Editor

Query API

Profile Explorer



Data Explorer :

The Data Explorer can only query a single data lake object or 

data model object and can only query up to 10 fields.


The Data Explorer can also only return up to 100 records.


Query Editor :


To get started with Query Editor you will first need to create a workspace. This workspace is a shared workspace that others can both view and use.


Query Editor can query across multiple data lake objects and data model objects and can return more fields and thousands of records.

You can also use SQL joins like inner joins and outer joins.


Note :

The timeout limit is five minutes so you will need to use some where clauses and limit clauses to filter down your records to make sure that your queries do not timeout.


Query Workspaces is a collaborative tool that allows you to query Data Model Objects, Data Lake Objects, Calculated Insights Objects, and Data Graphs.


Sunday, 8 December 2024

GraphQL

 Query language specification & runtime for APIs.

Single endpoint for all resources to be aggregated.

Efficient because only necessary data is requested.


TYPES :

Query : Entry point for read operations

Mutation : Entry point for create,update and delete.


EDGES :

Handles lists or relationships between nodes.

Links multiple nodes with info about the relationship.


NODES :

Individual data object or entity in schema.

Often encapsulate specific fields of the data.


ex :


query accounts {

  uiapi {

    query {

   Account {

     edges {

    node {

   Id

   Name {

      value

   }

}

   }

}

  

  }


}


Tuesday, 3 December 2024

JSON in Salesforce

 1.JSONGenerator :

Use this for manual control over JSON creation.

Perfect for building custom or dynamic JSON structures.


1.Need complete control over JSON Structure.

2.Add custom fields,logic or error handling.


2.JSON.serialize()

Quickly convert known objects or collections to JSON.

 e.g. Sending records to external system.

 

3.JSON.deserialize()

Automatically map JSON into salesforce objects.

 e.g. receiving data from APIs


4.JSON.deserializeUntyped()

Handle dynamic or unknown JSON structures by converting them into Apex Maps and Lists.


1.Unknown or dynamic JSON schemas.

2.JSON with extra or nested fields not directly tied to Salesforce objects.


5.JSONParser

Handle dynamic or unknown JSON structures by converting them into Apex Maps and Lists.


1.Need granular control over JSON parsing.

2.Working with complex or deeply nested JSON.


JSONGenerator                       : Custom JSON creation with full control

JSON.serialize()                      : Converting objects into JSON quickly, when structure matches the      object.

JSON.deserialize()                  : Converting JSON to salesforce objects easily

JSON.deserializeUntyped()     : Dynamic JSON structures with unknown fields or nested data

JSONParser                              : Fine-grained control for parsing JSON token by token.


Thursday, 21 November 2024

Navigate from one app to another in Lightning Web Components

 New in Winter ’20 is the ability for developers to use the navigation mix-in to direct users to an App, or a page specifically within an app.


import { LightningElement } from 'lwc';

import { NavigationMixin } from 'lightning/navigation';

export default class NavToApp extends NavigationMixin(LightningElement) {

  navigateToApp() {

    // Use the built-in 'Navigate' method

    this[NavigationMixin.Navigate]({

      type      : "standard__app",

      attributes: {

        appTarget: "Sales",

      }

    });

  }

}


You can now specify a type of standard__app and provide an appTarget key with the name or ID of the application ID.

Wednesday, 20 November 2024

How the salesforce flow transform element saves you loops?

 Salesforce Flow Transform Element allows you to reshape data on the fly within your flow. Think of it as a tool that acts like a data transformer that adjusts, formats, and cleans up your data before it moves to the next step in your process. 

Transform Element gives you the superpower of applying formulas, performing calculations, or converting data into a different format that your flow or subsequent actions require.

With the Winter '25 release, the transform element now supports primitive data types as well. This means you can start with a record collection, transform data, and update a text or a number collection.

Monday, 11 November 2024

User Access and Permissions Assistant

 Salesforce package 'User Access and Permissions Assistant' developed by Salesforce Labs (https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000FeF99UAF&tab=r)

You can do :

Analyze permissions for a user and their origin

Convert profiles to editable permission sets

Analyze and report on permissions and access

Understand which Permission Sets have specific permissions enabled

Manage your permission set groups and the permissions that they contain

Sunday, 3 November 2024

Zero Copy in Salesforce Data Cloud

 Data Cloud empowers enterprises to unify diverse data sources, harmonize that data, derive insights, and activate it effectively. 

This capability allows organizations to create a comprehensive 360-degree view of their customers.


What is Zero Copy?


Zero Copy refers to the process by which external data is accessed without copying or ingesting it into Data Cloud and vice versa.

Instead of importing data, Data Cloud retrieves and processes the external data on demand. It keeps data in memory temporarily and discards it once the task is complete. 


Bidirectional Integration


Data Cloud’s Zero Copy functionality operates in both directions. When integrated with external platforms, Zero Copy enables seamless access to external data from within Data Cloud (Data Federation), 

and conversely, it allows Data Cloud data to be accessed from external platforms (Data Sharing). This bidirectional capability ensures fluid interaction between Data Cloud and partner systems without the overhead of data duplication.


The Core Principle: Openness and Extensibility


Zero Copy is made possible by one of Data Cloud’s foundational principles: openness and extensibility. 

This principle is embedded in every layer of the Data Cloud technology stack, enabling smooth, efficient support for Zero Copy and ensuring compatibility with external systems.


Zero Copy Data Federation

Zero Copy Data Federation allows Data Cloud to access external data seamlessly, without requiring data ingestion. This integration works in two primary modes: query federation and file federation.





Let's break down how Zero Copy federation works with an example:


Suppose an enterprise stores its customer data in Salesforce CRM and provisions a Data Cloud instance within their Salesforce organization to bring over this CRM data. However, their order data is stored in Snowflake, and they want to derive insights by combining customer data from CRM with corresponding orders from Snowflake. Since the enterprise has heavily invested in Snowflake, they don’t want to duplicate their order data into Data Cloud.


This is where Zero Copy Data Federation comes into play. The enterprise registers their Snowflake details in Data Cloud for the Order data, creating an External Data Lake Object in Data Cloud. This object holds only the metadata of the Snowflake Orders table such as  table name, schema, and connection string. It doesn’t store the actual data.


Query Federation


In query federation, Data Cloud accesses external data by federating queries directly to the external source via JDBC drivers. In this case, federating queries refers to executing a single query across multiple data sources in different systems, without the need for duplicating data into a single system.


In our above example, when a query is executed in Data Cloud that requires Orders data, the Data Cloud query engine recognizes the external source and uses the Snowflake JDBC driver to query Snowflake directly. The Orders data is retrieved, processed in memory, and discarded after use—no data is stored in Data Cloud.


File Federation


File federation functions similarly to query federation, but with one key difference: the external source's compute resources are not involved. In file federation, instead of executing a query via JDBC, the Data Cloud query engine directly accesses the external source’s storage location.


In query federation, the external system (e.g., Snowflake) executes the query using its own compute resources. By contrast, in file federation, Data Cloud interacts only with the external storage, bypassing the external compute layer entirely. This allows Data Cloud to access large datasets directly from the external storage without involving the computational resources of the external data warehouse.


Both approaches of Zero Copy Data Federation—query federation and file federation—provide enterprises with the flexibility to access external data on demand. This preserves the existing investments in external data platforms while avoiding the need for data duplication or movement into Data Cloud.


The metadata of Zero Copy external objects registered in Data Cloud is presented within Salesforce in the same manner as native Data Cloud objects. This alignment allows Zero Copy external objects to seamlessly integrate with many core Salesforce features just like native Data Cloud objects. As a result, these external objects can be utilized in Flows, CRM enrichments, Related Lists, and other Salesforce functionalities. This offers a consistent user experience while extending the capabilities of the platform to external data without the need for data replication.


Zero Copy Data Sharing

Salesforce Data Cloud supports bidirectional Zero Copy, enabling seamless sharing of Data Cloud data with external data warehouses without duplicating or transferring the data—this is known as Data Sharing. The process mirrors Data Federation, where only the metadata of the Data Cloud objects is registered in the external warehouse, and the actual data is accessed on demand directly from Data Cloud.



Workflow Example: Sharing Data with Snowflake

Consider a scenario where a customer wants to share Data Cloud data with their Snowflake warehouse. The steps are as follows:


Defining the Sharing Target: The customer begins by specifying Snowflake as the sharing target within Data Cloud.

Creating a Data Share: The customer defines a data share in Data Cloud, selecting the objects they wish to share with Snowflake. This share is linked to the Snowflake target.

Metadata Registration: Behind the scenes, an integration between Data Cloud and Snowflake pushes the metadata of the shared Data Cloud objects into Snowflake. This metadata then appears in the customer's Snowflake account as an external share.

On-Demand Data Access: When the external table in Snowflake is queried, the metadata provides the necessary information to locate the corresponding Data Cloud storage. Data is retrieved on demand directly from Data Cloud, with no duplication. The integration also handles credential management to securely access Data Cloud storage.


Query Path for Data Sharing

Data Sharing can also occur through the query path. External warehouses can access Data Cloud data via the Data Cloud JDBC driver, enabling seamless querying of Data Cloud objects without the need to directly interact with the Data Cloud storage layer. As of Summer 2024, this is the path that Databricks uses for their Zero Copy integration to access data from Data Cloud.


This approach ensures that enterprises can leverage Data Cloud’s data within their existing external warehouses efficiently, maintaining the benefits of their current data architecture while avoiding the complexity of data copying or replication.


Tuesday, 29 October 2024

Salesforce Models API

 Generations API       - Single-turn interactions

Chat Generations API  - multi-turn interactions

Feedback API          - gathering user feedbacks

Embeddings API        - semantic similarity tasks

Monday, 28 October 2024

Agentforce for Developers

 Salesforce In-House LLMs powering Agentforce for Developers


CodeGen 2.5

xGen-Code


CodeGen 2.5 is a compact model designed primarily for programmer-specific features such as 'code completion' and 'Code Generation'.

xGen-Code, a robust model tailored for Salesforce Developer use cases, excelling in tasks that blend natural language processing (NLP) with programming capabilities.

xGen-Code powers the latest feature, Dev Assistant, and stands out for its ability to handle complex, multi-turn interactions and dynamic chat functionalities, setting a new standard in both open and closed-source model performance.


Sunday, 27 October 2024

Chatbots vs Copilots vs Agents

 𝗖𝗵𝗮𝘁𝗯𝗼𝘁 

Focus: conversations and information retrieval. 

Capabilities: Answer FAQs, provide customer support, and collect data. 

Decision-making: Limited and on responses. 

 

𝗖𝗼𝗽𝗶𝗹𝗼𝘁 

Focus: Collaboration and assistance in specific tasks. 

Capabilities: Generate content suggestions, translate languages, answer complex questions, and offer feedback. 

Decision-making: Suggestive, provides options and insights but doesn't make final decisions. 

 

𝗔𝗴𝗲𝗻𝘁𝘀 

Focus: Autonomous learning and action. 

Capabilities: Make decisions, perform tasks, adapt to situations, and interact with the environment. 

Decision-making: Independent, based on learned data and algorithms. 

Sunday, 20 October 2024

Public Groups vs Queues

 𝐏𝐮𝐛𝐥𝐢𝐜 𝐆𝐫𝐨𝐮𝐩𝐬: 

->These are collections of users, defined to facilitate data sharing and collaboration. 

->They are ideal for scenarios where a team needs shared visibility and access to records but do not involve assigning ownership of those records. 

->Public groups are manually defined by administrators and can include users, roles, and other groups.


𝐐𝐮𝐞𝐮𝐞𝐬: 

These are collections of records that are not assigned to any specific owner. 

->Queues are used to manage and distribute workloads among team members. 

->Any member of a queue can claim ownership of a record from the queue. 

->Queues are especially useful for managing cases, leads, service contracts, and custom objects.

Friday, 18 October 2024

Winter '25 Release - Admin Highlights

 -> Dynamic Highlight Panel - replace compact layout.Add up to 12 fields,apply filter to fields (also available for mobile)

-> Dynamic Forms available on mobile!

-> Conditional Formatting for fields to show icons and color based on rules you set.

-> Einstein added to Report Formula (boo AI)

-> Custom Report Types (beta) - massively revamped page makes management easier.

-> List views much better performance (moved to lwc instead of aura)

-> Inline Edits to User List View

-> User Access Summary - added how permissions are granted.

-> Object Manager - where permissions are coming from


Wednesday, 16 October 2024

LWC local dev (Winter 25 Beta)

Instant preview

 -> don't have to deploy changes to org in order to preview your changes.

-> don't have to reload your browser.


Steps required to enable local dev


1.Enable local dev in setup.

2.Install the local Dev plugin in vs code

   sf plugins install @salesforce/plugin-lightning-dev

Tuesday, 15 October 2024

Einstein Search

 Einstein Search Perform semantic search on structure and unstructured content using Retrieval Augmented Generation.


Semantic search searches for meaning, not keyword.


How to use Data for Semantic search :


-> Select an embedding model

-> prepare the data

-> Convert that data into vectors

-> Store those vectors in a vector database

-> Index everything

-> Create an API for handling the semantic Searches

-> Keep refreshing the vector database as your data changes


Before you can create a retriever, you need to prepare the data.  

Data preparation involves loading, chunking, vectorizing, and storing content in a search-optimized way. 

A search index stores chunked and vectorized data.  When a search index is created in Data Cloud, a default retriever is created automatically.  

Default retrievers can’t be customized.  However, in Einstein Studio within Data Cloud, you can create your own customized retrievers.


Friday, 11 October 2024

Large Action Model (LAM)

 The main difference between a large action model (LAM) and a large language model (LLM) 

is that LAMs can perform actions based on user input, while LLMs can only generate content.



From Large Language Models (LLMs) to the innovative Large action model using xLAM family and xGen-Sales, 

Salesforce is transforming how sales and service teams operate.


Which LAMs Powers Agentforce?


Large Action Model family

➡️ Executes functions

➡️ Triggers real-world actions

➡️ Leaves traditional LLMs in the dust


xGen-Sales and xLAM :


Salesforce AI Research releases xGen-Sales and xLAM AI models to bring humans and autonomous agents together with data and actions.


Tuesday, 1 October 2024

Agentforce for Developers

 Agentforce for Developers (formerly known as Einstein for Developers) now has new capabilities! 

You can do a multi-turn chat. This means you can ask the assistant to suggest code changes for your requirement, provide more info to steer it in right direction if it does give you satisfactory response.

You can ask it to explain the code. It does a decent job explaining the logic.

You can also ask it to write boiler plate test code and create test cases..

You can ask it to write docs. This is so useful if you need to document your method signatures and parameters and need descriptions if you are building SDKs and libraries.

Monday, 30 September 2024

Predictive AI

 Artificial intelligence that studies historical data, identifies patterns and makes predictions about the future that can better inform business decisions.

keywords : Historical, Predict, forecast

1.For actionable insights, accurate forecast.

2.Aids strategic decision - making.

Predictive analytics models can be categorized into two main types: 

1.classification model (Binary or multiclass)

 Note : If you want to predict a categorical or discrete output value.

2.regression model (linear or nonlinear)

 Note : if want to predict a continuous or numerical output value.


Classification models are used to predict a categorical or discrete output value based on one or more input variables. For example, you can use a classification model to predict whether an email is spam or not based on its sender, subject, and content. Classification models can be binary or multiclass, depending on the number of possible output values. Binary classification models have only two output values, such as yes or no, while multiclass classification models have more than two output values, such as red, green, or blue. Some of the common classification models are decision trees, k-nearest neighbors, support vector machines, and neural networks.


Regression models are used to predict a continuous or numerical output value based on one or more input variables. For example, you can use a regression model to predict the sales revenue of a product based on its price, features, and customer feedback. Regression models can be linear or nonlinear, depending on the relationship between the input and output variables. Linear regression models assume a straight line relationship, while nonlinear regression models can capture more complex and curved relationships. Some of the common regression models are simple linear regression, multiple linear regression, polynomial regression, and logistic regression.


Saturday, 14 September 2024

Salesforce winter'25 updates

 1.Enhanced User List view


Make inline edits with an enhanced user list view.


Enable this feature! Go to the 'User Management Settings' page in Setup and enable the 'Enhanced User List View'.


View, sort, and filter user entries in a list format while making inline edits directly, thereby streamlining data updates. 

This enhancement allows for quick updates and modifications without the need to navigate away from the list view, making 

it easier than ever to manage user information.


2.New 'Dynamic Highlights Panel' Component in Lightning App Builder


Use the new Dynamic Highlights Panel in Lightning App Builder to easily configure your key fields, instead of using compact layouts in Setup.

You can make quick adjustments to this panel right in Lightning App Builder by dragging fields from the Fields tab, 

just like you do with fields in the Field Section. The panel is responsive and supports up to 12 fields. 

You can set component visibility, customize actions, and see changes immediately on the desktop.


3.New option 'Object Access' available on sObjects


Quickly check object permissions in Object Manager.


Get a comprehensive view of the permission sets, permission set groups, and profiles that grant access to a specific object, 

including the level of access granted in Object Manager via the new Object Access menu item in the sidebar. 

With this read-only Object Access Summary in Object Manager, you can quickly check object permissions, 

making it easier to troubleshoot issues, perform security reviews, and determine how to grant users access effectively.


4.'Access Granted By' feature on View Summary of the user record


We’ve made user management easier than ever by providing visibility into the profiles, permission sets, 

and permission set groups that grant permissions to a specific user.

You can now quickly access information about a user’s assigned object, field, user, and custom permissions on the User Access Summary page. 

Simply go to the user record in Setup and click View Summary. To see how an individual permission was granted, click the row-level action and select Access Granted By.


5.'View summary' in Public groups


Manage public groups more efficiently.


Simplify managing public group membership with our enhanced public group summary page. You can handle the users, roles, 

and nested groups within a public group easier than ever before. You can search through all current and available members, 

adding or removing up to 100 members simultaneously. Now that’s a productivity booster! Additionally, 

you can edit and delete the selected public group directly from its summary page.


Wednesday, 11 September 2024

𝟓 𝐀𝐩𝐞𝐱 𝐔𝐧𝐢𝐭 𝐓𝐞𝐬𝐭 𝐭𝐢𝐩𝐬 𝐞𝐯𝐞𝐫𝐲 𝐒𝐚𝐥𝐞𝐬𝐟𝐨𝐫𝐜𝐞 𝐝𝐞𝐯 𝐬𝐡𝐨𝐮𝐥𝐝 𝐤𝐧𝐨𝐰

 𝟏. 𝐂𝐨𝐝𝐞 𝐬𝐭𝐨𝐫𝐚𝐠𝐞

You can save up to 6 MB of Apex code in each org, but test classes annotated with @isTest don’t count toward this limit.


𝟐. 𝐍𝐨 𝐬𝐞𝐩𝐚𝐫𝐚𝐭𝐞 𝐝𝐚𝐭𝐚𝐛𝐚𝐬𝐞 𝐟𝐨𝐫 𝐭𝐞𝐬𝐭𝐢𝐧𝐠

Even though test data rolls back, it still uses the same database. For objects with unique field constraints, inserting duplicates in tests can result in errors. Be careful!


𝟑. 𝐓𝐞𝐬𝐭 𝐦𝐞𝐭𝐡𝐨𝐝𝐬 𝐝𝐨𝐧’𝐭 𝐬𝐞𝐧𝐝 𝐞𝐦𝐚𝐢𝐥𝐬

No worries about accidentally spamming your users. Test methods are safe from triggering emails.


𝟒. 𝐍𝐨 𝐞𝐱𝐭𝐞𝐫𝐧𝐚𝐥 𝐜𝐚𝐥𝐥𝐨𝐮𝐭𝐬 𝐢𝐧 𝐭𝐞𝐬𝐭𝐬

Test methods can’t make callouts to external services, but you can use mock callouts to simulate API responses.


𝟓. 𝐒𝐎𝐒𝐋 𝐬𝐞𝐚𝐫𝐜𝐡𝐞𝐬

Any SOSL search in a test returns empty results by default. To ensure predictable results, 

use Test.setFixedSearchResults() to define the records you want.

Wednesday, 28 August 2024

Available Values of context variables in before and after events

 Before insert  ==>Trigger.new.


After insert    ==>Trigger.new,Trigger.newMap.


Before update ==>Trigger.new,Trigger.newMap,Trigger.old,Trigger.oldMap.


After update   ==>Trigger.new,Trigger.newMap,Trigger.old,Trigger.oldMap.


Before delete   ==>Trigger.old,Trigger.oldMap.


After delete     ==>Trigger.old,Trigger.oldMap.


After undelete ==>Trigger.new,Trigger.newMap.

Tuesday, 27 August 2024

use of Type.forName() in apex

 How can we put Type.forName() to better use in Apex?


In Salesforce Apex, there's a method called `Schema.getGlobalDescribe()` that helps developers get information about all the objects in Salesforce. 


This can be useful, but it can also use up a lot of computer resources, like CPU and memory. 


This method is like a double-sided sword! 


You can take advantage of it however, if things go wrong it can hurt you too. 


Let's focus more on the downsides.


This can be a problem, especially if your Salesforce organization has many custom objects and fields, and it can cause your code to run slowly and hit some limits on how much CPU time it can use.


Imagine you want to get information about just one object.


But if you use this method incorrectly, you might end up getting information about all the objects in your Salesforce.


This can slow things down and cause issues. 


This is called an anti-pattern. (Now what's an anti-pattern? We will save it for another day).


What's the solution then?


You will take advantage of  'Type.forName'.


Find the code below to understand how to use it.




Monday, 26 August 2024

Data flow into and outside of Data Cloud

 Here is the summary of Data flow into and outside of Data Cloud(DC):


Step 1: Data will flow as a Data Streams into Data cloud in three different ways(Batch,Streaming,Virtual)


 Batch : Sales or Service or Other Salesforce objects will flow into DC from multiple Orgs in every 10mins,B2C Commerce Cloud or Salesforce Marketing Cloud will flow into DC from each Org in every 1 hour or every 1 day.

 Streaming : Experience Cloud or Websites or Mobile Apps through APIs and SDKs from multiple sources into DC in every 2 mins or immediately.

 Virtual : Snowflake Data into DC immediately.


Step 2: The data inside DC gets stored into Data Lake Objects (DLOs)


Step 3: From DLOs we do the Data transformations and Mappings into other DC specific object called Data Model Objects(DMOs).


Step 4: The Data from DMOs takes either of or three different paths:

 Path 1 : The data from DMOs will flow into Calculated Insights(CIs) in every 1 hour. From CIs to Data Actions(DA) in every 1 hour.


 Path 2 : The data from DMOs will flow into Streaming Insights(SIs) in every 5 mins. From SIs to Data Actions(DA) in every 1 hour.


 Path 3 : The data from DMOs will flow into Identity Resolution (IRs) and from IRs to Unified Profiles(UPs) in every 1 day.


Step 5: The Data from the above 2 paths Path 1 and 2 stored in Data Actions will then Transformed and sent into Sales Cloud or Service Cloud or Slack or SFMC Journeys in every 1 hour.


Step 6: The Data from the above path 3 and the Data in SI of path 2 will be sent to Segmentation in every 1 hour. Then to Activation. 


Step 7: The Data from Activation will be sent to SFMC,B2C Commerce Cloud,AWS and other destinations through APIs.


In a nutshell, The data is collected from several sources in multiple formats will be Mapped,Unified, Enriched as a single profile and will be stored back into Target systems for further utilzations.



Thursday, 15 August 2024

Some of the cool things SF will automatically take care of when it comes to sharing tables

 1. If you change owner - all manual shares with Row Cause as Manual will be truncated .


2. If you insert duplicate share records - salesforce will automatically do the duplicate management 


3. If you change the account on the contact associated to the community user all manual shares of the user will be truncated


If you do not want the manual shares to be truncated ( when owner changes / community user’s account changes ) use custom Apex sharing reason when inserting the share records.

Get started with new Data Cloud instance

 1) Assign User Permissions


Once all the relevant licenses have been procured and access has been provided, the first step is to assign yourself the Data Cloud Admin / Marketing Admin Permission Set. 


2) Configure and Create Additional Permissions


Next, create and assign an additional permission set to support proper generation. Assign the new permission set to your user. 


3) Provision Your Instance


Once completed, you will notice (it may require a refresh) that the Data Cloud App and Setup are now available. You can begin the one-time process of provisioning your instance. 


Tuesday, 6 August 2024

Annotations in Apex

 𝗔𝗻𝗻𝗼𝘁𝗮𝘁𝗶𝗼𝗻𝘀 𝗮𝗻𝗱 𝗧𝗵𝗲𝗶𝗿 𝗨𝘀𝗲𝘀

1. @𝗔𝘂𝗿𝗮𝗘𝗻𝗮𝗯𝗹𝗲𝗱: Exposes methods to Lightning components for client-side calls.

2. @𝗗𝗲𝗽𝗿𝗲𝗰𝗮𝘁𝗲𝗱: Marks methods/classes as outdated for future removal.

3. @𝗙𝘂𝘁𝘂𝗿𝗲: Runs methods asynchronously, ideal for callouts.

4. @𝗜𝗻𝘃𝗼𝗰𝗮𝗯𝗹𝗲𝗠𝗲𝘁𝗵𝗼𝗱: Allows methods to be called from Flows.

5. @𝗜𝗻𝘃𝗼𝗰𝗮𝗯𝗹𝗲𝗩𝗮𝗿𝗶𝗮𝗯𝗹𝗲: Exposes variables in methods for Flow integration.

6. @𝗜𝘀𝗧𝗲𝘀𝘁: Marks classes/methods for unit testing.

7. @𝗧𝗲𝘀𝘁𝗦𝗲𝘁𝘂𝗽: Prepares test data for use across tests.

8. @𝗧𝗲𝘀𝘁𝗩𝗶𝘀𝗶𝗯𝗹𝗲: Makes private members accessible in tests.

9. @𝗝𝘀𝗼𝗻𝗔𝗰𝗰𝗲𝘀𝘀: Controls JSON serialization/deserialization.

10. @𝗡𝗮𝗺𝗲𝘀𝗽𝗮𝗰𝗲𝗔𝗰𝗰𝗲𝘀𝘀𝗶𝗯𝗹𝗲: Shares code across namespaces.

11. @𝗥𝗲𝗮𝗱𝗢𝗻𝗹𝘆: Retrieves up to 1,000,000 rows; no DML allowed.

12. @𝗥𝗲𝗺𝗼𝘁𝗲𝗔𝗰𝘁𝗶𝗼𝗻: Exposes methods to JavaScript in Visualforce.

13. @𝗦𝘂𝗽𝗽𝗿𝗲𝘀𝘀𝗪𝗮𝗿𝗻𝗶𝗻𝗴𝘀: Suppresses warnings to clean up console messages.

Friday, 2 August 2024

LWC Workspace API methods

 The lightning/platformWorkspaceApi module provides LWC Workspace API methods to control workspace tabs and subtabs in a Lightning console app.


Below wire adapters are available for Lightning console apps.

EnclosingTabId()      — Returns the ID of the enclosing tab.

IsConsoleNavigation() — Determines whether the app it’s used within uses console navigation.


ex :


import { LightningElement, wire } from 'lwc';

import { IsConsoleNavigation,EnclosingTabId } from 'lightning/platformWorkspaceApi';


// wire service to fetch if the component is inside a console app

@wire(IsConsoleNavigation)

    isConsoleNavigation;   //Returns true if console navigation is present, false otherwise.

@wire(EnclosingTabId) 

   enclosingTabId;        //Returns the enclosing tab ID if the caller component is within a tab, or null otherwise.



openTab()—Opens a new workspace tab. If the tab is already open, the tab is focused.


import { LightningElement, wire } from 'lwc';

import { IsConsoleNavigation, openTab } from 'lightning/platformWorkspaceApi';


 @wire(IsConsoleNavigation) isConsoleNavigation;


 async openTab() {

        // Ensure that we're in a console app

        if (!this.isConsoleNavigation) {

            return;

        }


        // Open contact list a new tab

        await openTab({

            pageReference: {

                type: 'standard__objectPage',

                attributes: {

                    objectApiName: 'Contact',

                    actionName: 'list'

                }

            },

            focus: true,

            label: 'Contacts List'

        });

    } 


refreshTab()—Refreshes a workspace tab or a subtab specified by the tab ID.

import { LightningElement, wire } from 'lwc';

import {IsConsoleNavigation,getFocusedTabInfo,refreshTab } from 'lightning/platformWorkspaceApi';


 @wire(IsConsoleNavigation) isConsoleNavigation;


    async refreshTab() {

        // Ensure that we're in a console app

        if (!this.isConsoleNavigation) {

            return;

        }


        // Refresh current tab

        const { tabId } = await getFocusedTabInfo();

        await refreshTab(tabId, {

            includeAllSubtabs: true

        });

    }

focusTab()—Focuses a workspace tab or subtab.

getAllTabInfo()—Returns information about all open tabs.


import { LightningElement, wire } from 'lwc';

import {focusTab,IsConsoleNavigation,getFocusedTabInfo,getAllTabInfo } from 'lightning/platformWorkspaceApi';


 @wire(IsConsoleNavigation) isConsoleNavigation;


    async focusNextTab() {

        // Ensure that we're in a console app

        if (!this.isConsoleNavigation) {

            return;

        }


        // Get current tab and figure out which tab is next

        const { tabId } = await getFocusedTabInfo();

        const allTabs = await getAllTabInfo();

        const selectedTabIndex = allTabs.findIndex(

            (possibleNextTab) => possibleNextTab.tabId === tabId

        );

        const nextTabId = allTabs[selectedTabIndex + 1].tabId;


        // Focus on next tab

        await focusTab(nextTabId);

    }

closeTab()—Closes a workspace tab or subtab.



import { LightningElement, wire } from 'lwc';

import {closeTab,IsConsoleNavigation,getFocusedTabInfo } from 'lightning/platformWorkspaceApi';


 @wire(IsConsoleNavigation) isConsoleNavigation;


    async closeTab() {

        // Ensure that we're in a console app

        if (!this.isConsoleNavigation) {

            return;

        }


        // Close current tab

        const { tabId } = await getFocusedTabInfo();

        await closeTab(tabId);

    }


disableTabClose()—Prevents a workspace tab or subtab from closing.

getFocusedTabInfo()—Returns information about the focused workspace tab or subtab.


import { LightningElement, wire } from 'lwc';

import {disableTabClose,IsConsoleNavigation,getFocusedTabInfo } from 'lightning/platformWorkspaceApi';

@wire(IsConsoleNavigation) isConsoleNavigation;


    async disableTabClose(event) {

        // Ensure that we're in a console app

        if (!this.isConsoleNavigation) {

            return;

        }


        // Toggle the ability to close the tab

        const close = event.detail.checked;

        const { tabId } = await getFocusedTabInfo();

        await disableTabClose(tabId, close);

    }

openSubtab()—Opens a subtab within a workspace tab. If the subtab is already open, the subtab is focused.


import { LightningElement, wire } from 'lwc';

import {IsConsoleNavigation,EnclosingTabId,openSubtab } from 'lightning/platformWorkspaceApi';

@wire(IsConsoleNavigation) isConsoleNavigation;

    @wire(EnclosingTabId) enclosingTabId;


    findEnclosingTabAndOpenSubtab() {

        // Ensure that we're in a console app and that we have a tab open

        if (!this.isConsoleNavigation || !this.enclosingTabId) {

            return;

        }


        // Open sub tab

        openSubtab(this.enclosingTabId, {

            pageReference: {

                type: 'standard__objectPage',

                attributes: {

                    objectApiName: 'Account',

                    actionName: 'list'

                }

            }

        });

    }

setTabHighlighted()—Highlights the specified tab with a different background color and a badge. 

Tab highlights don’t persist after reloading a Lightning console app.


import { LightningElement, wire } from 'lwc';

import { IsConsoleNavigation,getFocusedTabInfo,setTabHighlighted } from 'lightning/platformWorkspaceApi';


 @wire(IsConsoleNavigation) isConsoleNavigation;


    async highlightTab(event) {

        // Ensure that we're in a console app

        if (!this.isConsoleNavigation) {

            return;

        }


        // Toggle highlight for current tab

        const highlighted = event.detail.checked;

        const { tabId } = await getFocusedTabInfo();

        setTabHighlighted(tabId, highlighted, {

            pulse: true,

            state: 'success'

        });

    }


setTabIcon()—Sets the icon and alternative text of the specified tab.


import { LightningElement, wire } from 'lwc';

import { IsConsoleNavigation,getFocusedTabInfo,setTabIcon } from 'lightning/platformWorkspaceApi';


const TAB_ICON = 'utility:animal_and_nature';

const TAB_ICON_ALT_TEXT = 'Animal and Nature';


@wire(IsConsoleNavigation) isConsoleNavigation;


    async setTabIcon() {

        // Ensure that we're in a console app

        if (!this.isConsoleNavigation) {

            return;

        }


        // Change current tab icon

        const { tabId } = await getFocusedTabInfo();

        setTabIcon(tabId, TAB_ICON, {

            iconAlt: TAB_ICON_ALT_TEXT

        });

    }

setTabLabel()—Sets the label of the specified tab.


import { LightningElement, wire } from 'lwc';

import {IsConsoleNavigation,getFocusedTabInfo,setTabLabel} from 'lightning/platformWorkspaceApi';


const TAB_LABEL = 'Awesome Label';


 @wire(IsConsoleNavigation) isConsoleNavigation;


    async setTabLabel() {

        // Ensure that we're in a console app

        if (!this.isConsoleNavigation) {

            return;

        }


        // Change current tab label

        const { tabId } = await getFocusedTabInfo();

        setTabLabel(tabId, TAB_LABEL);

   }



getTabInfo()—Returns information about the specified tab.


import { LightningElement, wire } from 'lwc';

import { EnclosingTabId, getTabInfo } from 'lightning/platformWorkspaceApi';


@wire(EnclosingTabId) tabId;


    isSubTab;


    connectedCallback(event) {

        if (this.tabId) {

            getTabInfo(this.tabId).then((tabInfo) => {

                this.isSubtab = tabInfo.isSubTab;

            });

        }

    }


NavigationMixin module in LWC

 We know that the NavigationMixin module is used for navigating between different pages or components within the Salesforce Lightning Experience, Salesforce Mobile App, and Lightning communities from an LWC.


The NavigationMixin adds two APIs to your component's class.


1) [NavigationMixin.Navigate](pageReference, [replace]) - A component calls this API to navigate to another page in the application.


    ex :

      this[NavigationMixin.Navigate]({

            type: 'standard__recordPage',

            attributes: {

                recordId: this.yourRecordId,

                objectApiName: 'Account',

                actionName: 'view'

            },

        });

2) [NavigationMixin.GenerateUrl](pageReference) - A component calls this API to get a promise that resolves to the resulting URL. The component can use the URL in the href attribute of an anchor. It can also use the URL to open a new window using the window.open(url) browser API.


Example of opening up a window in a new Tab


 // Generate a URL to a User record page

 this[NavigationMixin.GenerateUrl]({

   type: 'standard__recordPage',

   attributes: {

     recordId: this.yourRecordId,

     actionName: 'view',

  },

 }).then((url) => {

  // Opens the tab in new page

  window.open(url, "_blank");

});

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


Saturday, 22 June 2024

configuration Attributes(CPQ)

 Configuration Attributes are a great feature that enables users to input a value directly in the configuration page of a bundle. This makes user a lot easier  instead of keeping separate SKUs for all possible combinations of sizes and colors a company could have for its products.

 

There are two types of attributes in Salesforce CPQ that are

 Configuration Attribute

 Global Attribute

 

When we wish to add a configuration attribute and assign it to a bundle product, we will construct a record with the record type configuration attribute.


A record called Configuration Attribute with the record type Global Attribute is created whenever we want to create and assign any attribute to an option product.

Wednesday, 19 June 2024

What is a reasoning engine?

 A reasoning engine is an AI system that mimics human-like decision-making and problem-solving capabilities based on certain rules, data, and logic. There are three types of human reasoning or inference mechanisms reasoning engines tend to emulate: 


Deductive reasoning – makes an inference based on universal and generally accepted facts. For example: “All birds lay eggs. A pigeon is a bird. Therefore, pigeons lay eggs.”

Inductive reasoning — derives a conclusion from specific instances or samples. This might look like: “Every dog I meet is friendly. Therefore, all dogs are friendly!” 

Abductive reasoning – makes a probable conclusion from incomplete (and often ambiguous) information, such as: “There are torn papers all over the floor and our dog was alone in the apartment. Therefore, the dog must have torn the papers.” 


Einstein Copilot

 Einstein Copilot is not just any Copilot. It is unique for 3 reasons:

==> It is Conversational means you can interact with it in natural language

==> It is Extensible by virtue of Einstein 1 platform with access to trusted and complete customer data and metadata.

==> It is Autonomous and acts as a reasoning engine to address a vast variety of user needs.


Monday, 3 June 2024

PreventDefault() method in Javascript

 In Lightning Web Components (LWC), we can use the preventDefault() method to prevent an event's default behavior.


The PreventDefault() method is available on events (Such as button clicks,form submission etc.).


When you call PreventDefault() on an event, it stops the default action 

that the browser would normally take for that event.


Common Use cases include preventing form submissions, link navigation or 

button clicks from triggering their default behavior. 

List of Data Cloud concepts and Terminologies

Data Stream

This is where we start with the data. When you create a data stream you select the data source you want to bring into Data Cloud, this could be Salesforce data or external data. Furthermore, a data stream can stream data or process it in batches.

Data Lake Object : 

Once data has been loaded into Data Cloud it is stored in a Data Lake Object (DLO), this will contain all the fields from the Data Stream objects as well as the additional custom fields created in the Data Stream setup.

Object Category

Each data object you bring into Data Cloud (DLO), must have a category of “profile”, “engagement” or “other”. This is important as it helps determine how you can use and map your data downstream. Any data used to identify and describe a customer is categorized as "profile" - this could be lead, contact, account etc. Any data directly related to a customer or account and related to actions is categorized as "engagement" - this could be activities, opportunities etc. Any data that doesn't fit into these buckets should be categorized as "other" - this data is often static reference data and could be a product catalog.

Data Model Object :

Data Model Objects describe a data model that DLOs are mapped to, it is a way of organizing all the data making sure data is grouped and related where relevant as this makes it easier to act on. The data is mapped to Data Model Objects (DMO) that is a logical grouping with a collection of fields or attributes including lookups. It's important to note that data is not store in DMOs, it's just a schema. Consider using Data Cloud for multi-org, where the same type of object will exist multiple times, the DMO makes sure all contacts or opportunities are appended even though they are stored in different objects. Note that some features in Data Cloud demands that DLOs have been mapped to DMOs for you to leverage them.

Data Kit :

Data Kits are a selection of metadata that are packaged and can be used again and again. For instance if you connect a Salesforce environment and want to add Sales data there is a data kit available that will create the DLO, DMO and relationships, thus you don't have to create them from scratch.

Data Space :

When many people are working with data in Data Cloud you may want to restrict the data a user can see, this can be achieved with data spaces. You select the data sources and data filters are available. In other words, data spaces determines what data you can see where standard permission sets determines what you can do with the data you have access to. All orgs will have a default data space, but more data spaces can be created if you want them.

Identity Resolution :

The likelihood of you having the same profile multiple times in your Data Cloud environment is great especially considering how profiles often are fragmented with one record having the phone number and another having an email. In the scenario of fragmented data there is no way to join the data based on two different contact points. To help resolve this, we can leverage identity resolution that based on rules you set up to join fragmented data into a unified object. You can only use the individual DMO or the account DMO in identity resolution rules.

Profile & Unified Profile :

There is a standard DMO for individual and account, each one of those can have identity resolution applied to them which creates a unified account DMO or unified individual DMO. All profile data should be mapped to the account or individual DMO which gives you a total list of your customers and through that engagement related to them.

Calculated Insights :

You can use calculated insights to aggregate data for your customers such as a lifetime value calculation based on transaction data. These calculated insights can be used in segmentations and actions.

Data Transformations :

Data Transformations (streaming and batch) are great for preparing and cleaning your data for consumption. You may want to clean country and state to a specific standard you are using. If you are familiar with CRM Analytics' recipes it's similar as it's based on the same components.

Data Actions :

Data Actions are a process that is triggered in Data Cloud. For instance when you want to update records in Salesforce CRM with data from Data Cloud, the process is managed by a data action. Data Actions can also kick start a flow or Apex code.

Segments :

Segments are an marketing add on to Data Cloud. Segments are a group of customers targeted for a campaign based on rules you define with your profile data.

Activations :

Activations are a marketing add on. Activations are used when you have created a segment that you want to pass on to another system. For example you want to add individuals to a journey in Marketing Cloud or a Facebook campaign, thus segments can be activated to Salesforce as well as Salesforce partners.