Usually in trigger, we work on updating related lists we end up querying sObject and looping over it. Or we also make a MAP from that list of records which will create lots of loops and iterations. To avoid this. Salesforce provide us with a simple feature where you can write a SOQL query and return MAP directly.Continue reading “APEX: SOQL to MAP of sObject”
Recently after a major deployment, we took refresh of a sandbox org. One of the developers worked on a change request on the refreshed copy. Unfortunately, he forgot to change Named Credentials, Auth Provider, Remote site setting. After working on the change request, developer started testing the same. This resulted in record creation in third party application through API’s. There were many test records which were created in third party applications and the issue got escalated.Continue reading “APEX: How to check if ORG is Sandbox or Production”
I was working on a page in Aura component and the page is loaded on click of a button from a related list(It can also load from a quick Action button). AURA components have a behavior that a component loads with value in cache memory. Which means, AURA component can sometimes load the previously clicked value from URL. Behavior is unpredictable. Which means, Component can load updated value or it can also load previous URL parameter value. For which user may have to click refresh button to load new info.Continue reading “AURA: Updated URL Parameter Value in JS File”
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”
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.”