Posts

Showing posts with the label trailhead

Tip of the week # 216 : Salesforce Composite and Composite Tree API

Image
Salesforce Composite and Composite Tree API with Examples Description : Executes a series of REST API requests in a single POST request, or retrieves a list of other composite resources with a GET request. Salesforce REST Composite API's : Salesforce REST Composite : To perform multiple REST API calls in a single request.Batch multiple API sub-requests together, execute sequentially (or in parallel), and optionally reference results between them. Method:- Post (For Insert) URL:-/services/data/v64.0/composite Request Body :- { "compositeRequest": [ { "method": "POST", "url": "/services/data/v64.0/sobjects/Account", "referenceId": "newAccount", "body": { "Name": "Test Account" } }, { "method": "POST", "url": ...

Tip of the week # 215 : Salesforce REST API

Image
Salesforce REST API's with Examples Description : Salesforce REST API allows external applications to interact with Salesforce using HTTP methods like GET, POST, PATCH, and DELETE. It streamlines CRUD operations, making integrations simpler and more efficient. Types of Salesforce REST API's : Standard REST API : For basic record operations. (Below example for create account via REST API) Method:- Post URL:- /services/data/v36.0/sobjects/Account/ Request Body :- { "Name" : "Account from Rest API", "phone" : "1111111111", "website" : "www.salesforce1.com", "numberOfEmployees" : "100", "industry" : "Banking" } Response Body :- { "id" : "00190000001pPvHAAU", "errors" : [ ], "success" : true, ...

Tip of the week # 214 : Lightning Datatable with Mask and Unmasked

Image
Lightning Datatable with Mask and Unmasked Description : lightning-datatable displays tabular data where each cell with field values and value should be masked and unmasked. ADVANCED OPTIONS FOR lightning-datatable IN LWC : Component HTML Component JS import { LightningElement, track, api } from 'lwc'; import getContacts from '@salesforce/apex/ContactController.getContacts'; export default class MaskComp extends LightningElement { @track accounts; @api recordId; columns = [ { label: 'First Name', fieldName: 'FirstName', type: 'text' }, { label: 'Last Name', fieldName: 'LastName', type: 'text' }, { label: 'Email', fieldName: 'maskedEmail', type: 'button', ...

Tip of the week # 213 : Set up reCAPTCHA for Experience Cloud Site

Image
Set up reCAPTCHA for Experience Cloud Site Description : Set up reCAPTCHA in the Experience Cloud sites to ensure that the provider applications are filled in by humans, not bots.. Steps are following : Generate a Google reCAPTCHA site key, and copy the site key. For more information, From Setup, in the Quick Find box, enter Digital Experiences, and select All Sites. Click Builder next to the Experience Cloud site for your providers. Configure the security settings In the Settings section, select Security and Privacy. Click Edit Head Markup, and then paste this code: Make sure Lightning Locker is turned on. To add Google as a trusted site, click Add Trusted Site. For Name, enter Google. For URL, enter https://www.google.com. Make sure Active is selected, and then click Add Site. To add gstatic as a trusted site, click Add Trusted Site. For Name, enter gstatic. For URL, enter https://www.gstatic.com. Make su...

Tip of the week # 212 : Lightning Datatable hidden gems

Image
Lightning Datatable hidden gems Description : lightning-datatable displays tabular data where each column renders the content based on the data type. ADVANCED OPTIONS FOR lightning-datatable IN LWC : Displaying and formatting of columns with appropriate data types const columns = [ { label: 'Opportunity name', fieldName: 'OpportunityName', type: 'text' }, { label: 'Probability', fieldName: 'Probability', type: 'percent', cellAttributes: { iconName: { fieldName: 'TrendIcon' }, iconPosition: 'right', }, }, { label: 'Amount', fieldName: 'Amount', type: 'currency', typeAttributes: { currencyCode: 'EUR', step: '0.001' }, }, { label: 'Contact Email', fieldName: 'Contact', type: '...

Tip of the week # 208 : Lifecycle hooks in LWC

Image
Lifecycle hooks in Lightning Web Components (LWC) Description : In Lightning Web Components (LWC), lifecycle hooks are special methods that allow you to run code at specific points during a component's lifecycle — such as when it is created, inserted into the DOM, or removed or when reactive variables are changed. constructor() : Called when the component instance is created (before rendering or attaching to the DOM). import { LightningElement } from 'lwc'; export default class LifcCyclehook extends LightningElement { constructor() { super(); // always call super() for calling parent class constructor i.e LightningElement console.log('Constructor called'); } } Ideal for below used : Initialize default values for private properties but not for public properties. connectedCallback() : Called when the component is inserted into the DOM. ...

Tip of the week # 205

Image
Lightning Web Component with Youtube Controls. Description : Code snapshot for Lightning Web Component with Youtube Controls. YoutubePlayback.html YoutubePlayback.js import { LightningElement } from 'lwc'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; export default class YoutubePlayback extends LightningElement { iframeElement = null; playerReady = false; volume = 100; playbackSpeed =1; playbackSpeedOptions = [ { label: '0.5x', value:0.5}, { label: '1x...

Salesforce : Consultant Tip's 2024

Image
Salesforce : Consultant Tip's 2024 Many people are requesting to show all the tips as a web page so they can easily checkout for your usages so I'm creating a blogger for my followers and friends. : Tip of the week # 162 : Deploy Metadata Using REST API. Description : SDeploy using the deployRequest REST resource to initiate a request that handles all operations for the deployment. EndPoint : https://host/services/data/vXX.0/metadata/deployRequest Format : JSON Method : POST Authorization: Bearer token You can deploy or retrieve up to 10,000 files at once. AppExchange packages use different limits: They can contain up to 35,000 files. The maximum size of the deployed or retrieved .zip file is 39 MB. If the files are uncompressed in an unzipped folder, the size limit is 400 MB. Tip of the week # 161 : Styling Hooks for LWC. Description : Styling hooks use CSS custom properties which make it easy to customize component sty...

Developing Chrome Extensions for Salesforce

Image
Developing Chrome Extensions for Salesforce Chrome extensions are awesome, they provide amazing convenience that is limited only by your imagination. some of created by me: 1. Quick Test Run 2. Quick ChangeSet & Navigator 3. Quick Query Editor and CSV Exporter 4. Quick Debug 5. Quick Shortcut you can download from Chrome Web Store What are extensions? Extensions are small software programs that customize the browsing experience. They enable users to tailor Chrome functionality and behavior to individual needs or preferences. They are built on web technologies such as HTML, JavaScript, and CSS. An extension must fulfill a single purpose that is narrowly defined and easy to understand. A single extension can include multiple components and a range of functionality, as long as everything contributes towards a common purpose. Chrome Extension Structure A Chrome Extension is made up of a JavaScript, HTML, images and JSON. At its core is a manifest file which conta...