Saturday, October 12, 2019
Wednesday, October 9, 2019
PDF Reader as a Salesforce Lightning Web Component
This is a Lightning web component based on PDF.js library to render a PDF document (an unencoded string representation of the PDF blob) inside an
iframe
.Check the code below for this component:
https://github.com/iamsonal/lwc-pdfReader
Tuesday, October 1, 2019
A basic Salesforce to Salesforce integration using REST API and OAuth
You can use a connected app to request access to Salesforce data on behalf of an external application. For a connected app to request access, it must be integrated with the Salesforce API using the OAuth 2.0 protocol.
1. Create a connected app in one of the Salesforce instances as below:
You will need to replace the callback URL after the completion of step 2.
2. Create an Auth Provider. Replace the consumer key and secret with the values.
Replace the callback URL in the connected app with the callback URL generated while creating this auth provider.
3. Create a named credential
4. Some Apex code
1. Create a connected app in one of the Salesforce instances as below:
You will need to replace the callback URL after the completion of step 2.
2. Create an Auth Provider. Replace the consumer key and secret with the values.
Replace the callback URL in the connected app with the callback URL generated while creating this auth provider.
3. Create a named credential
4. Some Apex code
HttpRequest req = new HttpRequest();
req.setEndpoint('callout:Cross_Org_Report/services/data/v45.0/query?q=select+Email,FirstName,LastName+from+contact');
req.setMethod('GET');
Http http = new Http();
HTTPResponse response = http.send(req);
return response.getBody();
Subscribe to:
Posts (Atom)