Posts

Showing posts with the label VS Code

How to make HTTP callout from LWC

Image
Hello Trailblazers, In this blog we are going discuss about HTTP callouts from Client-side controller in LWC. In Aura components we have Apex controller with AuraEnabled method which have code for HTTP callout in it. We call this Apex method on execution of some action and then send the response back to Aura component for processing. But with Lightning Web Components we can easily make callout from Javascript itself using fetch method. If you are not familiar with fetch method then please checkout this link . fetch method primarily takes 2 parameters as input which are endpoint and information about request which includes method type, header information , body of the request all in JSON format. fetch(endpont, { REQUEST_INFO}).then((response => response.json())).then((responseData) => {PROCESS_responseData_HERE}); Let’s start with the implementation. I am going to use Data Faker Heroku app for demonstration. In this example I will be focusing on getting data from third party so ...

VS Code Editor Setup For Salesforce

Image
Visual Studio Code is the latest IDE for Salesforce Development and believe me it has eased developer’s life by providing rich functionalities. This post will help you to setup VS code editor for Salesforce development.  Downloads : 1.        Visual Studio Code 2.        Salesforce CLI Installing VS Code Editor To download Visual Studio Code navigate to link given above. From download page select your operating system and proceed to download. I will suggest you to download most stable version of VS Code Editor. Once download is complete, install it in the system. Once installation is complete, you’ll see below welcome screen. While installing make sure to select Add To PATH option. Now let’s go ahead and download Salesforce CLI.   Installing Salesforce CLI Salesforce CLI is a command line interface that simplifies development and build automation.  VS Code ...