twitter linkedin facebook instagram
  • Home
  • LWC
    • LWC Tutorial
    • LWC Tricks
  • Lightning(Aura)
    • Lightning Tutorial
    • Lightning Tricks
  • Apex
    • Triggers
  • Integration
  • LowCodeLove
  • Interview Q's
  • Misc

Salesforce Socrates


There comes a need to invoke multiple server calls from one JS controller method and also to control the sequence of the execution. If you have already tried this, your first time attempting it might have been a mess.

This can be accomplished by writing the second server call inside the first setCallback method, the third server call inside the second controller setCallback method and so on. Confusing??? Let us look at the code to get a better understanding.

Apex class with three methods - which we want to invoke from the same javascript method on the lightning controller

We have a lightning button on the UI

The JavaScript controller which defines how to invoke the three apex methods from one controller method.



Hope this is useful and if you have doubts, reach out to me through the comments section. I would love to hear you out. Stay safe and happy, until next time :)


Lightning Web Components are Custom HTML elements built using HTML and modern JavaScript. It is a Programming model based on modern web standards

LWC  Vs  Aura

 

Lightning Components can be built using two programming models: Lightning Web components and Aura Components. Lightning Web Components use core Web Components standards, whereas Aura is a Framework. Although there is a functional difference, LWC can co-exist and interoperate with Aura Programming. To the end-user components built by these two different models appear to be the same.

In the below example we have built two lightning cards, one by LWC and the other by Aura. We notice there is practically no difference between the two.




Why did we need frameworks and what changed now?

 

Until recent year’s web standards were not evolving at a rapid pace, they offered only limited features, which developers needed to build a large scale web application i.e.
rendering engine - It parses HTML, XML, and CSS documents, and the final layout is generated & displayed on the User Interface. In other words, it takes HTML code and interprets it into what you see visually.
standard elements - just as the name implies they are the standard reusable elements,
events -JavaScript's interaction with HTML is handled through events that occur when the user or the browser manipulates a page, and
a core language (ECMAScript 5). An application could not be built on web Components because of the following shortcomings:

  1. Rendering wasn’t optimized for continuous UI transformation.

  2. Standard UI elements were scarce and the standard didn’t support the creation of custom elements.

  3. The core language lacked modern constructs to write large and modular enterprise-class apps at the client-side (modules, classes, promises, decorators, etc).

Multiple Frameworks came up to fill the gap Aura, Angular, and React are to name some. They provided language extensions to support development i.e. modules (AMD and CommonJS), promises, classes, and other general utilities. Different frameworks introduced different component models and HTML templating approaches. Frameworks became different languages; as a result, skills were not transferable. Components written in different Frameworks are not interoperable.

Web Stack of 2019 - more standards, less framework

The need for coexistence, interoperability, and standardization led to the invention of a new set of standards in the community, the idea was to get rid of the layer of abstraction provided by the frameworks and the new task of the framework was to no longer to fill the gap but to provide a thin layer of specialized services for User Experience.

Take a look at the picture below to compare how web standards have changed over the years. All the things that frameworks like Aura had to do are now shifted to Web Standard.

The Lightning Web Components provides a layer of specialized services on top of the core stack, which includes:-
1. The Lightning Base Components
2. Lightning Data Service
3. User Interface API



How can I create a Lightning Web Component?

At the current time, LWC is not supported in the Developer Console. To develop Lightning web Components you will need an IDE tool with sfdx plug-ins - which enables interaction with salesforce org, among many other things. The trailhead module here walks you through the setting up of the Salesforce DX i.e. the tools required for developing and also in the module we will create the "Hello World" Component, which will get us started.






Picture this..

You have done your research and decided to implement Salesforce CRM for Managing your Customer Information.

You have networked like crazy to gather all the leads and integrated the data into Salesforce. Everyone is excited and eager for new possibilities in the Business. Lead generation is automated, centralized email marketing is in place and you have saved a lot of time by automating many of the best customer service techniques. Voila !!

But wait, hang on…

Some of your customers and prospects are giving your company negative feedback???

With a little investigation, you have learned that the duplicate records are causing trouble for the team. The Sales Reps are calling and sending emails to the same prospects and customers multiple times. Now this can not only drive your customer aggressive but also burns your productivity.

# What Comprises of Duplicate Data?

Data duplication is an incident when an organization has multiple copies of the same data source.
Exact carbon copy of a record is the most visible form of duplicate data, which is easiest to deal with. But they are not the only type.

The most common type of Duplicate Data is the partial duplicate that contains only certain duplicate information such as, Typos in names and addresses, Spacing in fields, and Use of nicknames instead of names.


# let’s say NO to duplicate data

There are many ways to combat Duplicate Data, the most accessible is the salesforce native Duplicate Management feature. Salesforce finds and handles duplicates using a combination of Matching rules and Duplication rules. Going by definition, 

Matching rules define how duplicate records are identified.

Duplicate rules define what happens when a user views a record with duplicates or starts creating a duplicate record.





When your Sales rep creates a contact, Salesforce looks for possible duplicates (1), based on the criteria in the matching rule; it returns the list of possible duplicates (2). The Duplicate rules at (3) determine what happens with Duplicate records, either block 🚫 the Sales rep from creating Duplicates or create the Duplicate record and throw an alert ❗.

1. Prevent users from creating Duplicate Records

You can create Duplicate rules to alert or block the Sales Rep from creating Duplicate records.




Learn more about how to create the rule from the official document here.

2. Show Duplicate records

If there exists a duplicate record in the database, show alerts when a Sales Rep opens the record.




The source for learning is here.

3. Find duplicates across your organization

Rules can be run across your org to find the bulk duplicate records. Find them, and merge. Navigate to the document to find the setup process.

# Monitor and Maintain Data Quality

There is more to talk about data quality, but let me wind up mentioning how important it is to relentlessly monitor, access, and improve data within the organization. Only through constant attention, you can safeguard your data. The simple way is to leverage on reports and dashboards. One App exchange package by Salesforce Labs, you would really like for this job is the Data Quality Analysis Dashboards App.

Let's have a little hands-on here on the trailhead module for maintaining Data Quality.

This blog was about one simple way to prevent Duplicate data, Hope it was helpful. Please stay tuned to learn about App Exchange tools for Salesforce Data Management.




Start Tour


You just logged into Salesforce for the first time and landed on Home Page, it is stocked full of features. With so many tabs and elements, it is not uncommon to feel lost.

Salesforce comes to rescue with its “Start Tour” feature- as easy as it sounds- take that tour. This walks you through the main functions of the application.

It won’t reveal every feature, but it is enough to get you started with the basics.


Web components are a set of web platform APIs that allow you to create new custom, reusable, encapsulated HTML tags to use in web pages and web apps.
 
 

Web Components - introduced in 2011, are a set of features which allow creation of resuable components using just HTML, CSS and JavaScript.Features, built on the Web Component standards, can be used with (or without) any JavaScript library or framework (i.e. Aura, Angular, React, and Vue) and will work across all modern browsers.

To understand Web Components, we need to understand how it emerged. The key parameters driving the developments in the realm of technology are - better performance, reusability, standardization, interoperability.

DRY(Don’t Repeat yourself) Principle is one of the guiding principles behind Web components, It’s not a new concept and it has been around for a long time. The idea was to split the components into smaller chunks, which are reusable. However, there are limitations in terms of this implementation. For instance, a react component cannot be dropped as it is into the Angular framework or vice versa.


# How are Web Components filling the gap?


The key difference between web components and proprietary component systems is interoperability. Because they can be expressed as real HTML, they can be rendered by all the popular frameworks. So your components can be consumed more widely, in a more diverse range of applications, without locking users into any one framework.

Web components solve one of the biggest problems that programmers have while building application i.e. reducing repetition. The reason for this principle is that one copy of an element is much easier to maintain than multiple copies if the information needs to be changed, there is only one place to change it. In this way the principle promotes efficiency.

Now consider an application platform, consisting of several applications that are maintained by three different development teams. Each team has its own way of working and uses different tech stacks. Thanks to the reusable and interoperable nature of web components, teams don’t have to build the same components in different frameworks anymore.

# Which brings us to our next question - What are Web Components?


Web Components consist of four pillars that are used together.

  1. Templates
  2. HTML templates allow us to write markup under <template> tag.
    A component that renders UI has an HTML template file and a JavaScript class file.
    Content or markup implemented under <template> tag will not render any content until a script (JavaScript) has consumed the template, instantiated the code, and told the browser what to do with it.

  3. Custom Elements
  4. Custom elements allow for the creation of our own HTML tags or even tweak what is already available and then we can use it in HTML.
    It helps us encapsulate our custom functionality into an element rather than typing long nested HTML elements.

  5. Shadow DOM
  6. Shadow DOM is a web standard that allows you to encapsulate style and markup that can be linked to any HTML element.
    The Shadow DOM is a subtree that branches off the DOM. It hides away the complexity of components from the rest of the page.

  7. Imports
  8. How do we load an image in HTML , using an <img> tag, video had <video>. How do you import a HTML page?
    Just like how we import JavaScript and CSS in HTML using <link> or <script>, we can import another HTML page with the <link> tag.
    Include an import on your page by declaring a <link rel="import" href=” http://example.com/elements.html”>

# In Conclusion - The Future is Bright


Looking to the future, it’s clear that web components are the way forward. For more information on web Components read the official document in which you will find all about web components, custom elements, shadow DOM, and best practices.

Stay tuned.

Newer Posts

Trending

Search This Blog

About Me

About Me

LET’S STAY CONNECTED

Total Pageviews

Labels

  • aura
  • Lightning web components
  • LowCodeLove
  • Salesforce Tips
@INSTAGRAM

Twitter

Tweets by sirireddy2212

Pages

  • About Me

Blog Archive

  • ▼  2020 (5)
    • ▼  September (1)
      • "Invoke multiple apex methods" - from single light...
    • ►  July (2)
      • Introduction To Lightning Web Components
      • Data Quality is the yeast in the bread of business..
    • ►  June (2)
      • TIP OF THE WEEK #1 - Take the Tour
      • Building with Web Components
Created By SoraTemplates | Distributed by GooyaabiTemplates