Wednesday, 16 April 2025

Salesforce Experience Cloud

 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 contractor users with a ’Standard’ license.


Membership : 

Junction of a user & an experience ; grants a person access.



Customer community, customer community plus and partner community constitute the vast majority of used experience cloud licenses.


Commerce Portals : Similar to Customer Community, less standard objects,  more custom objects.


External Apps : similar to Partner, more storage, API calls, custom objects.


Channel Account : Same as partner, but billed per partner (instead of per user)


Named User vs User Login Licenses :


Named User :

Named, dedicated user record; associated with all corresponding logins over time.


User Login :


Not named or dedicated to one person; associated with an instance of authenticated access.


Setup a Experience Cloud Users :


  1. Employee : Create user from Users setup.
  2. Customer : Create user from Contact record.
  3. Partner : Enable account, create user from contact


Key Elements of a Experience Cloud Template

Theme, Pages, components and configuration


Org Settings that impact Communities :

  • Chatter
  • Feed Tracking
  • Topics for Objects
  • Knowledge


Key Communities Settings


  • Community Domain (required)
  • Enable ExperienceBundle Metadata API
  • Enable Partner Super User Access
  • Allow using standard external profiles for self-registration and user creation
  • Enable Account Relationship


Community Data Security Elements

  • Object & Field Access

Access is granted to users through profiles or permission sets.

  • Organization - wide Sharing

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; external cannot be more open than internal.


  • Record Sharing

Builds on OWD sharing settings.

Granular record sharing can be facilitated in various ways:

  • Manual (one-off; share x with z)
  • Sharing rules (if x=y, share x with z)
  • Apex sharing (advanced sharing rules)

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 licenses 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 users with whom data is shared can be internal or partner users.


  • Account Relationships


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 be associated with various data types, including :

  • Knowledge articles
  • Standard and custom objects
  • Chatter posts
  • Files
  • User (Knowledge Experts)


Knowledge in Communities :


Knowledge is a paid offering that surfaces articles via a self-service knowledge base.


It plays a critical role in many partner, customer and employee communities.


Two versions are available

        

          1.classic ( with Article Types)

           2.Lightning (with Record Types)


Saturday, 22 March 2025

Salesforce Integration Mastery ticks

 1.Set Timeout on HTTP Callouts – Always set a timeout on HTTP callouts to prevent long-running transactions from consuming resources.


2.Use Named Credentials for OAuth Flows – Store authentication details securely and simplify token refresh handling.


3.Use HttpCalloutMock for Test Classes – Mock callout responses in tests to avoid dependencies on external systems.


4.Handle Platform Event Failures Gracefully – Implement retry logic for platform event subscribers to handle transient errors.

Thursday, 20 March 2025

Some important Flow Events to use when LWC is embedded inside a screen flow

 Some important Flow Events to use when LWC is embedded inside a screen flow.


1.FlowAttributeChangeEvent:


This event is triggered when a component's property changes during the flow execution. It's vital for keeping data in sync and ensuring that components react in real-time to user input or system changes.

syntax:

 const attributeChangeEvent = new FlowAttributeChangeEvent(

 'todos',

 this._todos

 );

 this.dispatchEvent(attributeChangeEvent);



2.FlowNavigationBackEvent :


If your flow includes multiple screens, this event allows users to go back to the previous screen, offering a more fluid and user-friendly experience, especially in complex processes that require review or corrections.


3.FlowNavigationNextEvent:


This event moves the flow forward to the next screen, ensuring smooth navigation between screens without manual intervention.


syntax:

 // check if NEXT is allowed on this screen

 if (this.availableActions.find((action) => action === 'NEXT')) {

 // navigate to the next screen

 const navigateNextEvent = new FlowNavigationNextEvent();

 this.dispatchEvent(navigateNextEvent);

 }



4.FlowNavigationPauseEvent:


Sometimes, you need to pause a flow. Whether it’s waiting for a user decision or external input, this event lets you pause the flow at any point, offering flexibility in how the flow operates.


5.FlowNavigationFinishEvent:


This event signals the end of the flow. Once triggered, it effectively terminates the flow, ensuring the user knows when the process is complete, and no further actions are needed.



Thursday, 13 March 2025

𝗔𝘃𝗼𝗶𝗱 𝗖𝗣𝗨 𝗧𝗶𝗺𝗲 𝗟𝗶𝗺𝗶𝘁𝘀 𝗶𝗻 𝗔𝗽𝗲𝘅

 Ever faced the dreaded "𝗔𝗽𝗲𝘅 𝗖𝗣𝗨 𝘁𝗶𝗺𝗲 𝗹𝗶𝗺𝗶𝘁 𝗲𝘅𝗰𝗲𝗲𝗱𝗲𝗱" error? 

Salesforce enforces a 𝟭𝟬-𝘀𝗲𝗰𝗼𝗻𝗱 𝗖𝗣𝗨 𝘁𝗶𝗺𝗲 𝗹𝗶𝗺𝗶𝘁 𝗽𝗲𝗿 𝘁𝗿𝗮𝗻𝘀𝗮𝗰𝘁𝗶𝗼𝗻, and hitting it can crash your process.


Here are 𝟱 𝗣𝗿𝗼 𝗧𝗶𝗽𝘀 to optimize CPU usage in Apex:


𝟭. 𝗔𝘃𝗼𝗶𝗱 𝗡𝗲𝘀𝘁𝗲𝗱 𝗟𝗼𝗼𝗽𝘀 

Looping inside another loop can skyrocket CPU usage. Instead, use 𝗺𝗮𝗽𝘀 and 𝘀𝗲𝘁𝘀 for efficient lookups.


𝟮. 𝗨𝘀𝗲 𝗖𝗼𝗹𝗹𝗲𝗰𝘁𝗶𝗼𝗻𝘀 𝗘𝗳𝗳𝗶𝗰𝗶𝗲𝗻𝘁𝗹𝘆 

Instead of multiple SOQL queries inside a loop, 𝗾𝘂𝗲𝗿𝘆 𝗼𝗻𝗰𝗲 and process data in bulk using 𝗟𝗶𝘀𝘁𝘀 or 𝗠𝗮𝗽𝘀.


𝟯. 𝗥𝗲𝗱𝘂𝗰𝗲 𝗖𝗼𝗺𝗽𝗹𝗲𝘅 𝗖𝗮𝗹𝗰𝘂𝗹𝗮𝘁𝗶𝗼𝗻𝘀 

Break down complex logic, cache repetitive computations, and use 𝗹𝗮𝘇𝘆 𝗹𝗼𝗮𝗱𝗶𝗻𝗴 where possible.


𝟰. 𝗣𝗿𝗲𝗳𝗲𝗿 𝗔𝘀𝘆𝗻𝗰𝗵𝗿𝗼𝗻𝗼𝘂𝘀 𝗣𝗿𝗼𝗰𝗲𝘀𝘀𝗶𝗻𝗴 

For heavy operations, move logic to 𝗤𝘂𝗲𝘂𝗲𝗮𝗯𝗹𝗲 𝗔𝗽𝗲𝘅, 𝗕𝗮𝘁𝗰𝗵 𝗔𝗽𝗲𝘅, or 𝗣𝗹𝗮𝘁𝗳𝗼𝗿𝗺 𝗘𝘃𝗲𝗻𝘁𝘀 instead of synchronous execution.


𝟱. 𝗠𝗶𝗻𝗶𝗺𝗶𝘇𝗲 𝗥𝗲𝗰𝘂𝗿𝘀𝗶𝘃𝗲 𝗧𝗿𝗶𝗴𝗴𝗲𝗿𝘀 

Use static variables to prevent unwanted recursion and avoid unnecessary trigger executions.


𝗕𝗼𝗻𝘂𝘀 𝗧𝗶𝗽: Use the 𝗟𝗶𝗺𝗶𝘁𝘀.𝗴𝗲𝘁𝗖𝗽𝘂𝗧𝗶𝗺𝗲() method to track CPU usage in real-time and optimize accordingly.

Monday, 3 March 2025

How do you handle Large Data Volumes (LDV) in Salesforce?

 When dealing with millions of records, performance and scalability become crucial. Here are the best practices to efficiently manage Large Data Volumes (LDV) in Salesforce:


1️.Indexes & Skinny Tables – Use standard/custom indexes & skinny tables to optimize queries.

2️.Selective SOQL Queries – Filter records using indexed fields to avoid full table scans.

3️.Asynchronous Processing – Use Batch Apex, Queueable Apex, and Future Methods to handle bulk operations.

4️.Data Archiving – Move old data to Big Objects or external storage to improve performance.

5️.Bulk Data Processing – Utilize Bulk API, Data Loader, or ETL tools for efficient record management.

6️.Avoid Triggers on Bulk Operations – Always bulkify triggers & minimize DML operations inside loops.

7️.Use Composite API – Reduce API callouts by grouping multiple requests into one.

8️.Dividing Data by Ownership – Implement Divisional Sharing, Role Hierarchies, or Territory Management to optimize access control.


🔹 Additional Best Practices:

✅ Use Field History Tracking Efficiently – Track only necessary fields to avoid storage overhead.

✅ Optimize Reports & Dashboards – Apply filters on indexed fields to improve performance.

✅ Leverage External Objects (Salesforce Connect) – Store non-essential data externally & access via External Objects.


Sunday, 2 February 2025

Key Salesforce APIs & Their Use Cases

 🔹 REST API – Best for web & mobile apps, supports JSON & XML.

🔹 SOAP API – Ideal for structured enterprise integrations.

🔹 Bulk API – Handles massive data loads asynchronously.

🔹 Metadata API – Manages customizations & configurations.

🔹 Streaming API – Enables real-time notifications & updates.

🔹 Connect REST API – Integrates Chatter, B2B Commerce & more.