Skip to main content

Posts

Lightning Component Basic and Advanced

Lightning Component also refer as Aura Component Or Aura Framework is base on View-Controller Architecture. Refer the Below Image which has been taken from Trailhead Module. Aura architecture Server-Side Controller (Apex): Server calls are expensive, and can take a bit of time. Milliseconds when things are good, and long seconds when the network is congested. You don’t want apps to be locked up while waiting for server responses. The solution to staying responsive while waiting is that server responses are handled asynchronously. What this means is, when you click the Create Expense button, your client-side controller fires off a server request and then keeps processing. It not only doesn’t wait for the server, it forgets it ever made the request! Then, when the response comes back from the server, code that was packaged up with the request, called a callback function, runs and handles the response, including updating client-side data and the user interface. If you’re an exper

Efficient way to analyze Salesforce Debug log

Salesforce is one of the top CRM tool in the market currently. Thanks to the out of the box features and powerful tools inbuilt it is poised to continue being the top performers in the SAAS domain. Apart from the inbuilt ecosystem, Salesforce provides good development platform for developers to write custom code. This allows them to build anything they think of, imagination is the only limit. Thanks to this Developer friendly ecosystem, there are many awesome reusable custom designed components people have developed in Salesforce. Making the platform more robust and popular. As someone rightly said “With great power comes great responsibility” To make sure the code developed is defect free and errorless, there should be a powerful log tracking and analysis tool. Though Salesforce provides the ability to capture and save logs, it lacks few important features like: Log Readability Meaningful Labelling Smart Filtering Quick Component Reference To overcome these limita

The Top 5 Most Treasured Winter ‘20 Features

1.        The RECYCLE BIN is now in Lightning, and it’s even better 2.        The new Salesforce Mobile App is a game changer 3.        Printable View for Lists comes to Lightning 4.        Bye-bye Power of One fields. Hello Count Unique Values (Beta) 5.        Start a Flow on a Schedule The RECYCLE BIN is now in Lightning, and it’s even better Now we’ve View, Restore, Delete and The Tab for Recycle Bin. Why people love it: Accidental deletions happen more often than most of us would like to admit, and having the ability to easily find and “undo the oops” without switching back to Classic is on the shortlist of the most highly anticipated “better in Lightning” features. Printable View for Lists comes to Lightning Why people love it: Even if we live mostly in a digital world, there are still those times when you just need that hard copy. The Printable view gives you only the parts you need from the screen. Bye-bye Power of One fi

Salesforce CLI Command Reference

In real time we develop some business requirements in salesforce using configuration, then we need to push these change to Version control such as GitLab/Bit bucket. So we will come to know in how many way we can retrieve these changes from salesforce: source:retrieve Command Syntax:  sfdx force:source:retrieve Parameters: [-x MANIFEST] [-p SOURCEPATH] [-m METADATA] [-n PACKAGENAMES] 1. [-x MANIFEST] To retrieve all metadata components listed in a manifest: $ sfdx force:source:retrieve -x path/to/package.xml 2. [-p SOURCEPATH] To retrieve the source files in a directory: $ sfdx force:source:retrieve -p path/to/source To retrieve a specific Apex class and the objects whose source is in a directory: $ sfdx force:source:retrieve -p path/to/apex/classes/MyClass.cls,path/to/source/objects To retrieve source files in a comma-separated list that contains spaces: $ sfdx force:source:retrieve -p "path/to/objects/MyCustomObject/fields/MyField.field

Test Lightning Web ComponentsCall APIs from Apex

Test Lightning Web Components with Jest Framework Prerequisites: 1. Before installing sfdx-lwc-jest install Node.js and npm. 2. Node.js : This page lists two releases of Node.js. We recommend using the “LTS” (Long Term Support) version, rather than the “Current” version. Install Jest and Its Dependencies into Your Project npm install @salesforce/sfdx-lwc-jest --save-dev To Run test: npm run test:unit Component Folder Structure Create a folder named __tests__ at the top level of your component’s bundle directory. Update .forceignore with **/__tests__/** Test File Naming Conventions: Test files must have names that end in “.js”, and Salesforce recommend that tests end in “.test.js.” Jest runs JavaScript files in the __tests__ directory Example of package.json: {   ...   "scripts": {     ...     "test:unit": "sfdx-lwc-jest",     "test:unit:watch": "sfdx-lwc-jest --watch",     "test:unit:debug": "sfdx-lwc-jest --debu

Communicate with Events inLightning web components (LWC) - Salesforce Developers

There are mainly 3 approaches for communication between the Lightning components using events. Communication using Method in LWC ( Parent to Child ) Custom Event Communication in Lightning Web Component (Child to Parent ) Publish Subscriber model in Lightning Web Component ( Two components which doesn't have a direct relation ) 1. Communication using Method in LWC ( Parent to Child ) we can call the method of Child Component from the Parent Component with the help of JavaScript Methods. LWC have used @api decorator to make the children properties public available so parent can be able to call it directly using JavaScript API. For example create one public variable and method (which we need to access in parent component) in ChildComponent with @api decorator like below: ChildComponent: import  {  LightningElement ,  api  }  from   'lwc' ; export   default   class   HelloWorld   extends   LightningElement  {     @ api   name ;     @ api   message ;     @ api   upperCas

Configuration File Tags: targetConfigs

targetConfigs: Configure the component for different page types and define component properties. For example, a component could have different properties on a record home page than on the Salesforce Home page or on an app page. For Communities, only lightningCommunity__Default supports component properties. Supports the targetConfig subtag: Use a separate targetConfig for each different page type configuration. Specify one or more page types in the targets attribute, such as   <targetConfig targets="lightning__RecordPage"> or  <targetConfig targets="lightning__RecordPage,lightning__AppPage"> The targets attribute value that you specify must match one or more of the page types that you listed under <targets> for the component. Supports the property, objects, and supportedFormFactors subtags. property: Specifies a public property of a component that can be set in Lightning App Builder, App Manager, Lightning Flow Builder

Translate