Posts

Salesforce Platform Events

An event-driven architecture is built around events (meaningful state changes), producers , consumers , and channels that carry event messages between them. Producers don’t know who consumes their events, and consumers don’t care who produced them—this decoupling is what gives you flexibility and scalability in distributed systems. In Salesforce, the primary building blocks for this are: Platform Events — custom event definitions and messages Change Data Capture (CDC) — events for data changes on standard/custom objects Streaming / Pub/Sub API — external systems subscribe/publish Apex, Flows, and External Services — to publish/consume inside Salesforce What Platform Events Are Platform Events are Salesforce’s enterprise messaging mechanism used to publish and subscribe to real‑time event data across Salesforce and external systems.  Core Usage of Platform Events Real‑time integrations — Connect Salesforce with external systems using event-driven architecture. Decoupled busin...

Transaction Security Policy In Salesforce

Transaction Security Policies is a powerful feature used to enforce additional security measures based on user behavior. They allow administrators to set up rules that trigger actions when specific conditions are met during a transaction. Here’s a brief overview of how they work: Purpose : It's designed to enhance security by monitoring and responding to user actions in real-time. Conditions : Administrators can define conditions based on various factors such as user location, IP address, user agent, and more. Actions : When a defined condition is met, Salesforce can perform actions like blocking the transaction, logging an event, or executing a custom Apex code. Use Cases : TSPs are commonly used to prevent risky transactions, such as login attempts from unusual locations or outside normal working hours, helping to mitigate potential security threats. Configuration : They are configured through Salesforce Setup under Transaction Security Policies. Here, admins can c...

Salesforce Data Cloud

Image
Salesforce Data Cloud (formerly known as Salesforce Customer Data Platform or CDP) is a powerful real-time platform designed to unify customer data from various sources to create a comprehensive view of each customer.  Key Features of Data Cloud: Data Integration: It connects to various data sources, including CRM, ERP, e-commerce platforms, social media, and third-party systems, allowing seamless data integration. Real-Time Data Processing: Salesforce Data Cloud processes data in real time, enabling businesses to respond instantly to customer interactions and behaviors. Identity Resolution: The platform uses AI and machine learning to resolve duplicate customer records and create unified profiles by matching data points across different systems. Segmentation and Personalization: Marketers can create precise customer segments and personalize customer interactions across multiple channels like email, web, mobile, and in-person experiences. Data Activation: It empowers users to activ...

Page Views by Salesforce History

Get the currently logged in user 90 days page view history: SELECT Alias,Email,FirstName,Id,IsActive,Language,LastName,LastReferencedDate,LastViewedDate,Name,NameOrAlias,NetworkId,Phone,ProfileId,RecordTypeId,Title,Type,UserRoleId FROM RecentlyViewed Get the list of records where the user has read access (Using apex SOQL Query): SELECT RecordId FROM UserRecordAccess WHERE UserId=:UserInfo.getUserId() AND HasReadAccess = true AND RecordId IN :allRecordIds LIMIT 200

Create set in LWC JS component

Set insertion and deletion can be done but that is not reactive. Set declaration:     @ track   selectedAccountSet  =  new   Set ();   add the  value in set              this . selectedAccountSet . add ( *****VALUE***** ); remove the value in set              this . selectedAccountSet . delete ( ****VALUE**** );

Pass value from child lightning component to parent lightning component using Dispatch Event: LWC

Parent Lightning Component parentComponent.html < template >      < lightning-card >          < div   class = "slds-p-around-medium" >                 {selectedAccountId}              < template   for:each = {accountsList}   for:item = "accountRecord"   >                  < c-child-component   account = {accountRecord}   key = {accountRecord.Id}   onobjectlistitemselected = {handleObjectListItemSelected} ></ c-child-component >              </ template >          </ div >      </ lightning-car...

Salesforce: Read JSON Data in Apex class and map with object instance

//JSON Request/Body from the Server/External system String response = '[ {  "name": "account1", "Phone": "12345", "Opportunities" : {records:[{ "name": "opportunity1", "StageName": "1 - Qualified Lead"},{ "name": "opportunity2", "StageName": "1 - Qualified Lead"}]} }, {  "name": "account1", "Phone": "12345" } ]'; //Parse the JSON Body into List of Object (Key with value) List<Object> accountResponse = (List<Object>)JSON.deserializeUntyped(response); Map<String, Object> jsonResponseOpportunityValues; List<Account> AccountList = (List<Account>)JSON.deserialize(response, List<Account>.class); List<Opportunity> OpportunityList = new List<Opportunity>(); //Read one by one list of object instance values to retrive the child object Instance values for(Object ...