Recalculating Formula on a record without even querying the fields When you’re working in Triggers or in apex code, you may want to get a recalculated formula field values on a particular object. This can be done with the help of a method in the Formula class. Let’s have a look on syntax and an […]
Overriding the LWC standard component’s style As we all know that LWC uses shadow DOM which makes an isolation between our custom components and LWC standard components. When you add a style to your component’s css file it doesn’t apply to the standard components and that’s a limitation. Example: Let’s say you have a lightning-textarea […]
How to use Salesforce REST API in Lightning Component If you are working with REST/SOAP APIs in the apex class which is being used in the lightning component, then using UserInfo.getSessionId() will give the session id which can not be used to make the API calls due to security restrictions. There is a workaround for […]
How to use Lightning component into a Visualforce page Sometimes, you might have a situation where you want to access your lightning component in the Salesforce classic view and here ltng:outApp comes into picture. ltng:outApp : Is a component in the long namespace which is used to expose your lightning component outside of the lightning […]
How to validate fields in lightning components ( Form Validation in Lightning Component ) Some lightning components come with inbuilt validation and you need to trigger the validation in your client-side controller. Following components provide inbuilt validation support. lightning:input lightning:select lightning:textarea ui:input* lightning:input is more powerful when it comes to the validation as it honors […]
How to remove the arrows from lightning:input[type=”number”]? I think this is a generic question and Salesforce devs have looked for the ways to get rid of the spin buttons on the input field without changing it to text type for a purely numeric behaviour. You just need a few lines of CSS to solve your problem. […]
Is there a way to mass-check Checkboxes when updating a Profile’s Object’s Field-Level Security? Of course, there is. You can do it through your browser’s console. You just need the following Javascript code snippet which will do the job for you. For the Edit Permission var checkboxes = document.querySelectorAll(“.displayedCol input”); for (var i = 0; […]
Creating a dynamic SOQL which includes all the fields I have seen this question several times on developer forums and I thought it could be another addition to Salesforce cookies. If you are wondering how can you query all the fields of an object then you can use the following code snippet. https://gist.github.com/sfcure/81888ea3d0038b8f14df7c2006d98d7a The above […]
How to use namespace in managed lightning components If you are working on a lightning component and it’s going to be a part of a managed package then you need to take care of namespace in client side JS code if you are accessing any custom field. This can be handled in various ways but […]
- 1
- 2