There will be a scenario where you need to identify if Enter is presses or any special character is pressed. Below code will demonstrate how to identify a keypress code. In Lightning Web Component.
For this scenario we need to add a span section with onkeypress event above the input text field. And call a JS method. Something like this.
Continue reading “KeyCode of a key pressed in Lightning Web Component”
It is always a good practice to display a toast message so that users are aware of what is happening in system. A toast message can be show to user when you want to show a Success message or an Error message or a Warning message. Toast message is simple to write and very effective.
In this blog we will see all 3 ways in which we can display a toast message. A toast can also simply provide information. To display a toast notification in Lightning Experience or Lightning communities, import ShowToastEvent from the lightning/platformShowToastEvent module.
When you dispatch an event to show the toast message you need to know few properties that are used in toast message.
Continue reading “Toast Message in Lightning Web Component”
There are few things to note when you want to call an apex method.
Continue reading “Calling Apex Method with Parameters from a Lightning Web Component”
- Importing the Server-side method (apex class).
- Calling a Server-side method from JS method.
- Fetching the value that is returned.
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”
To Create, Edit and View a record “Quickly” you can use “<lightning-record-form />” tag. Salesforce automatically Loads all fields in the object’s compact or full layout, or only the fields you specify. There is no manual custom field tag that user need to add and customize the layout. Salesforce handles everything for you including the lookup fields.
Overall if you are looking for a quick solution to create a record instantly, you can go with <lightning-record-form />.
Every tag comes with some attributes. For this tag there are few important attributes that are usually used.
There are few more…
Continue reading “Lightning Web Component using lightning-record-form.”
As I mentioned in my previous blog(Introduction to Lightning Aura Component), Salesforce supports 2 different programming modules.
- Lightning Aura Component (LAC)
- Lightning Web Component (LWC)
Since LWC is a big topic we will cover just introductory part in this blog. So the question is –
What is Lightning Web Component (LWC)?
Continue reading “Introduction to Lightning Web Component and Basic Applications for LWC”