Skip to main content

Posts

Showing posts from April, 2021

How to use Hyperlink in Custom Toast Notification message using LWC

  Use Hyperlink in Custom Toast Notification message using LWC   We all know that a component can send a toast notification that pops up to alert users of a success, error, or warning. A toast can also simply provide information to the user. But what if we need a hyperlink on the message to navigate to the records on the message body. Yes, we can put Links as well on the message body as we can see in Standard Notification Toasts. This is very simple just we need to remember few things. We should know how to use Navigation Services by using NavigationMixin.GenerateUrl method. Let us see the functionality in this blog. To display a toast notification in Lightning Experience or Experience Builder sites we import ShowToastEvent from the lightning/platformShowToastEvent module. We use this ShowToastEvent to provide feedback to a user following an action, such as after a record is created. Now in this blog we will see how to add hyperlink in the message of the Show Toast event and navig

Build Custom Add to Favorites functionality in Salesforce

In this blog we will see how we can build a functionality to add different records from different Object as favorite records. Use Case: We have a requirement where we have a custom Page or an Application where we cannot see the standard Favorites button and we need to add the records to favorite list may be to visit it later. To meet this we can build our own button and an Object to meet the requirements to add the records as favorites. Approach: We need to configure Custom Object as below.  Object :- Add Favourites API Name :- Add_Favourites__c FIELDS Type API Name Favourites Formula (Text) HYPERLINK("/"& Object_RecordId__c , Object_Record_Name__c)   Favourites__c Object Name Text Object_Name__c Object Record Name Text Object_Record_Name__c Object RecordId Text Object_RecordId__c   Now let us create a simple