Salesforce Lightning

Lightning Web Component using lightning-record-edit-form

<lightning-record-edit-form />

Use the lightning-record-edit-form component to create a form that’s used to add a Salesforce record or update fields in an existing record. If you need a solution with custom screen, you need to use this tag. Whole layout need to be customized. The component displays fields with their labels and the current values, and enables you to edit their values.

lightning-record-edit-form supports the following features.

  • Editing a record’s specified fields, given the record ID.
  • Creating a record using specified fields.
  • Customizing the form layout
  • Custom rendering of record data.

If there is no customization required then you can go ahead with <lightning-record-form /> tag for development.

Continue reading “Lightning Web Component using lightning-record-edit-form”
Salesforce Lightning

SVG in Lightning Bundle

SVG stands for “Scalable Vector Graphics”. SVG defines vector-based graphics in XML format. Every element and every attribute in SVG files can be animated. SVG resource in lightning bundle can be used to define custom icons for your component. Here we are speaking about the icons and not logo. Icon and logo can look similar just like my blog’s icon and logo. But both are different. SVG deals with icons. By default if you see any component in salesforce, you can observe that default icon is undefined.

Continue reading “SVG in Lightning Bundle”
Salesforce Lightning

Design in Lightning Bundle

In design section you can control which attributes are exposed to builder tools like the Lightning App Builder, Experience Builder, or Flow Builder. A design resource lives in the same folder as yours .cmp resource, and describes the design-time behavior of the Aura component—information that visual tools need to display the component in a page or app.

<design:component label="Hello World">
    <design:attribute name="subject" label="Subject" description="Name of the person you want to greet" />
    <design:attribute name="greeting" label="Greeting" />
</design:component>
Continue reading “Design in Lightning Bundle”
Salesforce Lightning

Renderer in Lightning Bundle

Renderer in Client-side is to override default rendering for a component. You can consider what data should render on load or on reload. The framework’s rendering service takes in-memory component state and creates and manages the DOM elements owned by the component. If you want to modify DOM elements created by the framework for a component, you can modify the DOM elements in the component’s renderer. Otherwise, the framework will override your changes when the component is rerendered.

The base component in the framework is aura:component. Every component extends this base component.

This renderer has base implementations for the four phases of the rendering and rerendering cycles:

  • render()
  • rerender()
  • afterRender()
  • unrender()
Continue reading “Renderer in Lightning Bundle”
Salesforce Lightning

Style in Lightning Bundle

Sometimes there will be scenario where you need to define specific set of style to the tags that are used in component. This is similar to how style tags are defined in normal HTML pages or Visualforce pages. Only difference is style name definition will start with .THIS keyword. You can also define specific style tags for other devices like, mobile or tablet etc using @media.

Continue reading “Style in Lightning Bundle”
Salesforce Lightning

Helper in Lightning Bundle

Helper in lightning bundle is similar to controller where you write client-side javascript methods. These methods are more like reuseable methods which can be called from any controller method.

  • Helper is similar to controller but helper does not handle events.
  • Helper can be used to write reusable Javascript methods and these can be called from Controller section.
  • Helper functions also enable specialization of tasks, such as processing data and queueing server-side actions.
  • Helper methods are local to Component bundle.
  • Helper methods can be called from any controller javascript methods.
  • Declaring a helper method is similar to controller javascript method.
  • A helper function can pass in any arguments required by the function, such as the component it belongs to, a callback, or any other objects.
  • You can call a helper method from another helper method using this. operation.
Continue reading “Helper in Lightning Bundle”
Salesforce Lightning

Controller in Lightning Bundle

Controller handle client-side events in lightning bundle. It’s a JavaScript resource that defines the functions for all of the component’s actions. A client-side controller is a JavaScript object in object-literal notation containing a map of name-value pairs. Function can represent an action event. Client-side controllers are surrounded by parentheses and curly braces. Separate action handlers with commas.

Continue reading “Controller in Lightning Bundle”
Salesforce Lightning

Introduction to Lightning Aura Component.

Salesforce introduced lightning platform way back in 2014 and to build custom applications on lightning platform salesforce introduced Lightning Aura Components in Sprint 2015. Salesforce lightning is best known for its modern UI interface and beautiful look, which is a Platform as a Service (PaaS) platform that allows developers to create add-on applications that integrate into main salesforce.com application. These third-party applications are hosted on Salesforce.com’s infrastructure. In this blog we will see what a Lightning Aura Component contains.

Lightning Component.

The Lightning Component framework is a UI framework for developing single page applications for mobile and desktop devices. Lightning includes the Lightning Component Framework and some exciting tools for developers. Lightning makes it easier to build responsive applications for any device like desktop, mobile, tablet etc. As per Sprint’19 release you can build lightning component using two programing models.

  1. Lighting Aura Component.
  2. Lightning Web Component.
Continue reading “Introduction to Lightning Aura Component.”