Alert component
Although Salesforce will release a functionality in the Summer ’25 release (https://ideas.salesforce.com/s/winners) that allows for generating alerts with the option to discard records, in the meantime, I am providing an LWC that at least notifies users about the status of records. This Alert Component is a practical and versatile Lightning Web Component designed to enhance user notifications within your Salesforce environment. It supports different display methods (popup, banner) and alert types (warning, error, info), making it suitable for a wide range of use cases.
HACKS


it's a Lightning Web Component (LWC) designed to notify users about the status of records within Salesforce.
To use the component, upload it to your Salesforce organization and place it on the desired Lightning page. The code is alsoavailable at https://github.com/mpdigitals/alert-component-sfdc.
Configure the properties to customize the alert behavior and appearance.
Configure the component visibility to filter when the message should be shown. This can be done through the Lightning App Builder by setting visibility rules based on criteria such as user profile, record fields, or other conditions.
Configuration
Options
1. Type:
Popup: Displays the alert as a popup message.
Banner: Displays the alert as a banner at any place of the page.
2. Display PopUp Method:
Alert: Shows the alert using the LightningAlert component.
Toast: Shows the alert as a toast message using the ShowToastEvent.
3. Alert Type:
Warning: Indicates a warning that needs user attention.
Error: Displays an error message.
Info: Provides informational messages.
4. Alert Title: The title of the alert message.
5. Message: The main content of the alert message.


Types


SLDS alert banner
toast


ligthning-alert

