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.