Posts

Sharing Set in Digital Experience

Image
Give Experience Cloud site users access to records using sharing sets. A sharing set grants site users access to any record associated with an account or contact that matches the user’s account or contact. You can grant access to records via access mapping, which defines access for each object in the sharing set. Access mappings support indirect lookups from the user and target record to the account or contact.  For example, grant site users access to all cases related to an account that’s identified on the user’s contact records. A sharing set applies across all sites that a user is a member of. Record access granted to users via a sharing set isn’t extended to their superiors in the role hierarchy. Here're the steps to create a Sharing Set - From Setup, enter Digital Experiences in the Quick Find box, then select Digital Experiences | Settings. In the Sharing Sets related list, click New to create a sharing set, or click Edit to edit a sharing set. In the Sharing Set Edit page, ...

Salesforce Lightning Inspector Chrome Extension

Image
The Salesforce Lightning Inspector , a Google Chrome DevTools extension, is designed specifically for developers working with the Salesforce Lightning platform. This tool enables you to navigate the component tree, inspect component attributes, and profile component performance. The extension also helps you to understand the sequence of event firing and handling. The extension helps you to: Navigate the component tree in your app and inspect components and their associated DOM elements. Identify performance bottlenecks by looking at a graph of component creation time. Debug server interactions faster by monitoring and modifying responses. Test the fault tolerance of your app by simulating error conditions or dropped action responses. Track the sequence of event firing and handling for one or more actions. Link to Salesforce Chrome Lightning Inspector After installing Salesforce Lightning Inspector , the Chrome extension adds a Lightning tab to the DevTools menu. Open the Chrome Develop...

Salesforce Dev Hub

Image
Salesforce Dev Hub is a feature that enables organizations to manage multiple Salesforce environments and streamline the development lifecycle for building and deploying Salesforce applications. It provides a centralized hub for managing Salesforce development projects, environments, and resources. Salesforce Dev Hub provides a centralized platform for managing Salesforce development projects, environments, and resources, empowering organizations to adopt modern development practices, enhance collaboration, and accelerate the delivery of high-quality Salesforce applications. Select and Enable a Dev Hub Org Set Up Your Salesforce DX Environment Enable Dev Hub2 to: Create and manage scratch orgs from the command line Scratch orgs are disposable Salesforce orgs that are used to support development and testing. They are fully configurable, allowing developers to emulate different Salesforce editions with different features and preferences. View information about your scratch orgs Informati...

Salesforce EntityDefinition

Image
EntityDefinition Provides row-based access to metadata about standard and custom objects. EntityDefinition Note EntityDefinition fields are exposed in SOAP API version 45.0 and later. You can use Tooling API to query for EntityDefinition fields in guest user mode in API version 44.0 and earlier. In API version 45.0 and later, use SOAP API to get this data in guest user mode. EntityDefinition is still exposed in Tooling API to User Profiles with the ViewSetup permission.

Salesforce EntityParticle

Image
Entity Particle  Represents each element of a field that can be presented in a user interface. Contrast EntityParticle with FieldDefinition, which represents each element of a field defined in the Metadata API. EntityParticle has parity with describe, which returns API-accessible fields only for an entity. EntityParticle Let's say there is a requirement to fetch all picklist fields along their label, API Name. SOQL query using Entity Particle  SELECT EntityParticle.DeveloperName, Label, Value, IsActive, EntityParticle.IsDependentPicklist, EntityParticle.FieldDefinition.ControllingFieldDefinition.DeveloperName FROM  PicklistValueInfo  WHERE EntityParticle.EntityDefinition.QualifiedApiName = 'Case'  AND EntityParticle.IsDependentPicklist = TRUE  ORDER BY EntityParticleId, Label Results Retrieve all the fields of the 'Phone' data type

Salesforce EntityLimit

Image
EntityLimit EntityLimit is used to retrieve Limits displayed in the Setup UI for an object. EntityLimit Considerations SOQL Limitations SOSL Limitations Here's an example to retrieve the limits of an Object

@TestVisible Annotation in Apex

In Salesforce, the @TestVisible annotation makes private or protected variables and methods visible in test classes. This annotation allows you to access and manipulate these elements for testing purposes without changing their access modifiers, thereby maintaining encapsulation and security in production code while enabling thorough testing. Here is an example  public class MyClass {     // Private member variable     @TestVisible private Integer myPrivateVariable = 09; } @isTest  private class TestVisibleClassTest {     @isTest static void testExample() {         // Access private variable annotated with TestVisible         Integer i = MyClass. myPrivateVariable;         System.assertEquals(09, i);     }  } Here are the key points about the @TestVisible annotation: Visibility : @TestVisible makes private or protected variables, properties, and methods visible in test...