When working with custom Lightning-combobox in LWC most of the time you will face problems making combo box a required field. When using a Lightning-record-edit-form, you usually use lightning-input-field tag and it takes care of all the FLS (Field Level Security) and irrespective of field type it handles every type of field. However, there will be scenarios where lightning-input-field may not be suitable and end up using a custom tag. For instance, a custom lookup field or multi select custom lookup field or a custom record type selection combo box. You end up using a custom solution for these.
Continue reading “LWC: Lightning-Combobox required field validation on submit button”AURA: Clear cache while loading a Lightning Component.
Usually because of cachable=true in apex class, you see results in lightning Aura component same as previous one, Event thought the records are updates, you do not see any updated values. To prevent Lightning aura component from loading component with same results we need to clear cached value.
To clear cache, you have to fire refreshview on component as shown below.
Continue reading “AURA: Clear cache while loading a Lightning Component.”How to get BASE URL in LWC
We actually don’t need BASE URL when we are using relative URL to work on <a/> tag. However we do need BASE URL when working on absolute URL.
Usually when working on a record, we have record ID, but we need to redirect using a <a/> tag on click of the name. and We may some time need to generate absolute URL and append record if to it. In this blog we will see how we can get BASE URL in lightning web component’s Javascript file.
Continue reading “How to get BASE URL in LWC”Displaying HTML tags from a text field in lightning component
There will be occasions when you need to display some HTML tags like images or icons based on some condition and you end up using a formula text field to create a dynamic tag and save it as text field. It can also be a Rich-Text-Area field which will be saved as a HTML tag in backend.
Continue reading “Displaying HTML tags from a text field in lightning component”