Sharepoint Integration With Salesforce

Hi Folks,
In this post, I want to address how we can integrate Sharepoint with Salesforce through Microsoft Graph API. We all know that we are in the era of cloud. We may want to connect two cloud services. So, How can we do that? Through integrating one cloud service into another cloud service. Let's start the integration. (If you want to integrate Sharepoint to other applications, convert the below code into any language that you used in your application.)

What is Sharepoint?

Organizations use SharePoint to create websites. You can use it as a secure place to store, organize, share, and access information from any device. It is a very robust content management and document management platform used by all kinds of companies, mainly for storing business-related documents and content. It is mostly used as a secure document repository for intranet portals, websites, cloud-based services, and of course as an independent repository as well.

What is the Microsoft Graph API?

Microsoft Graph is the gateway to data and intelligence in Microsoft 365. You can use the Microsoft Graph API to build apps for organizations and consumers that interact with the data of millions of users. With Microsoft Graph, you can connect to a wealth of resources, relationships, and intelligence, all through a single endpoint: https://graph.microsoft.com.

All set, let’s get started!

Register Your Application in Azure Portal

  • Sign in to the Azure Portal. (https://portal.azure.com/)
  • Go to the Azure Active Directory in the left side navigation pane.
  • 1) Click App Registrations then 2) Click New application registration.
  • Follow the below steps.
          1) Enter the Name of your application. 
          2) Choose application type as "Web App/ API". 
          3) Enter Sign-on URL like "https://mycustomdomain.my.salesforce.com".
          4) Click "Create".



  • Now you will get the registered application information. Copy and keep the Application ID somewhere we will use it later.
  • Go to settings in the top menu in your application info section.
  • Go to the Required Permissions.

 
  • Click the "Add" button to add the permissions to your application.
  • Now we have two steps to do. 1) Select an API 2) Select Permissions for that API. In our case, we need to select the "Microsoft Graph" API and in the next step, we will give permissions related to this API. 
  • Currently, I am giving "Read and write files in all site collections" permission only.  We will add more permissions later. 
  • Don't forget to click the "Done" button after adding permissions.
  • It's a time to generate Private Key for our application. Go Back to the "Settings" navigation pane. Then click "Keys". Fill the description of the key and then select expires duration. Then click the "Save" button. It will provide us a private key. Copy the key value and store it in a secure place. You won't be able to retrieve the same key after. 
  • To add more permissions to your app, go to the "App registrations (Preview)" section. Then select the app that we created recently (Force Application).  Copy the "Directory (tenant) ID" we will use it later.
  • Then Click the "View API Permissions" button. 
  • Now go to "Add a Permission".
  • In "Select an API" section select "Microsoft Graph" API.
  • Go to the "Delegated Permissions" and add the listed permissions. Also, add the permissions in the "Application Permissions" section as well. 
  • The following permissions are required to create a folder and upload files in Sharepoint.
     Delegated permissions :
          Files.Read
          Files.Read.All
          Files.ReadWrite
          Files.ReadWrite.All
          Sites.Read.All
          Sites.ReadWrite.All
     Application Permissions:
          Files.Read.All
          Files.ReadWrite.All
          Sites.Read.All
          Sites.ReadWrite.All

Application Permissions - Your client application (Salesforce) needs to access the Web API (MS Graph API) directly without user context. This type of permission requires administrator consent and is also not available for Native client applications.

Delegated Permissions - Your client application (Salesforce) needs to access the Web API (MS Graph API) as the signed-in user, but with access limited by the selected permission. This type of permission can be granted by a user unless the permission is configured as requiring administrator consent.
  • After adding permissions don't forget to "Grant admin consent". (See the bottom of the API Permissions page)
Let's test our application.

Authorization

As of now, we noted three values 1. Application ID (Client Id) 2. Private Key (Client Secret) 3. Tenant ID. See the below code for authorization.  Store access_token in the public variable so that we can use it in other processes.

String clientId = 'my application id'; 
String clientSecret = 'my private key';
String tenantId = 'my tenant id';
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('POST');
req.setHeader('Content-Type', 'application/x-www-form-urlencoded');
//https://login.microsoftonline.com/< tenant Id>/oauth2/token
req.setEndpoint('https://login.microsoftonline.com/'+EncodingUtil.urlEncode(tenantId, 'UTF-8').replaceAll('\\+', '%20')+'/oauth2/token'); 
String body = 'grant_type=client_credentials'+
    '&client_id=' + EncodingUtil.urlEncode(clientId, 'UTF-8') +
    '&client_secret='+ EncodingUtil.urlEncode(clientSecret, 'UTF-8') +
    '&resource=https://graph.microsoft.com';                              
req.setBody(body);
HttpResponse res = h.send(req);
System.debug('Response Body: ' + res.getBody());
//Parse the response and store the access_token in public variable to use it in other methods.

I added the sample response from Postman for the above request.

Note: Below example are to upload files in the Sharepoint host/root site. If you want  to upload files to other sites your URL format Should be: 
https://graph.microsoft.com/v1.0/sites/{site-id}/drives/    (get drive list)
https://graph.microsoft.com/v1.0/sites/{site-id}/drives/{drive id}/root/children      (create a folder)
https://graph.microsoft.com/v1.0/sites/{site-id}/drives/{drive id}/root:/{folder path}/{file name}:/content (upload a file)

Get the Drive List

Below code shows how to get a list of drives available to your application. In Sharepoint, every "Document Library" considered as a separate drive. If you know your drive (Document Library) ID then skip this step. From drive list find your drive with the help of "webUrl" or "name" in the response and store the "id" in a global variable like Custom Settings in salesforce. 

String access_token= 'access_token';
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setHeader('Authorization', 'Bearer '+ access_token);
req.setHeader('Content-Type', 'application/json');
req.setHeader('Accept', 'application/json');
req.setEndpoint('https://graph.microsoft.com/v1.0/drives/');
HttpResponse res = h.send(req);
System.debug('Response Body: ' + res.getBody());
//Get your drive id from the response and store it somewhere.

In my case, I want to store my files in Documents. 


Create a Folder

Run the below code to create a folder in Root library.
URL format to create a child folder: https://graph.microsoft.com/v1.0/drives/{drive id}/root:/{parent folder path}:/children.
URL format to create the Folder with Parent Folder Id instead of folder path : https://graph.microsoft.com/v1.0/drives/{drive id}/items/{parent folder id}/children.
Also, @microsoft.graph.conflictBehavior have three values fail, replace, and rename.

String access_token= 'access_token';
String driveID = 'my drive id';
String folderBody = '{"name": "New Folder","folder": { },"@microsoft.graph.conflictBehavior": "rename"}';
string endPoint = 'https://graph.microsoft.com/v1.0/drives/' + 
                        EncodingUtil.urlEncode(driveID, 'UTF-8').replaceAll('\\+', '%20') +
                        '/root/children';
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('POST');
req.setHeader('Authorization', 'Bearer '+ access_token);
req.setHeader('Content-Type', 'application/json');
req.setHeader('Accept', 'application/json');
req.setEndpoint(endPoint);
req.setBody(folderBody);
HttpResponse res = h.send(req);
System.debug('Response Body: ' + res.getBody());



Make sure that the folder created successfully in SharePoint.

Upload a File

Run the below code to upload the file in "New Folder" which we created previously. This method only supports files up to 4MB in size.
URL format to upload file with parent folder path: https://graph.microsoft.com/v1.0/drives/{drive Id}/root:/{parent folder path}/{file name}:/content.
URL format to upload file with parent folder id: https://graph.microsoft.com/v1.0/drives/{drive Id}/items/{parent folder id}:/{file name}:/content.

String access_token= 'access_token';
String driveID = 'my drive id';
String folderName = 'New Folder';
String fileBody = 'Hello World!';
String fileName = 'My Document.txt';
String endPoint = 'https://graph.microsoft.com/v1.0/drives/' + 
                                EncodingUtil.urlEncode(driveID, 'UTF-8').replaceAll('\\+', '%20') +
                                '/root:/'+EncodingUtil.urlEncode(folderName, 'UTF-8').replaceAll('\\+', '%20')+'/'+
                                EncodingUtil.urlEncode(fileName, 'UTF-8').replaceAll('\\+', '%20')+':/content';
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('PUT');
req.setHeader('Authorization', 'Bearer '+ access_token);
req.setHeader('Content-Type', 'text/plain');
req.setHeader('Accept', 'application/json');
req.setEndpoint(endPoint);
req.setBodyAsBlob(Blob.valueOf(fileBody));
HttpResponse res = h.send(req);
System.debug('Response Body: ' + res.getBody());

Make sure that the file uploaded successfully in SharePoint.

Worried about upload large files? We have a Resumable File Upload feature.

Resumable Upload

Create an upload session to allow your app to upload files up to the maximum file size. An upload session allows your app to upload ranges of the file in sequential API requests, which allows the transfer to be resumed if a connection is dropped while the upload is in progress.

To upload a file using an upload session, there are two steps:
1.Create an upload session
2.Upload bytes to the upload session

1.Create an upload session
The response to this request will provide the details of the newly created uploadSession, which includes the URL used for uploading the parts of the file.
String access_token= 'access_token';
String driveID = 'my drive id';
String parentFolderId = 'My parent folder id';
String fileDesc = '{"@microsoft.graph.conflictBehavior": "rename"}';
String fileName = 'largeFile.txt';
string endPoint = 'https://graph.microsoft.com/v1.0/drives/' + 
                                EncodingUtil.urlEncode(driveID, 'UTF-8').replaceAll('\\+', '%20') +
                                '/items/'+EncodingUtil.urlEncode(parentFolderId, 'UTF-8').replaceAll('\\+', '%20')+':/'+
                                EncodingUtil.urlEncode(fileName, 'UTF-8').replaceAll('\\+', '%20')+':/createUploadSession';
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setHeader('Authorization', 'Bearer '+ access_token);
req.setHeader('Content-Type','application/json');
req.setHeader('Accept', 'application/json');
req.setMethod('POST'); 
req.setEndpoint(endPoint);
req.setBody(fileDesc);
HttpResponse res = h.send(req);
System.debug('Response Body: ' + res.getBody());

Copy the uploadUrl from the response.

2.Upload bytes to the upload session
To upload the file or a portion of the file, your app makes a PUT request to the uploadUrl value received in the createUploadSession response. You can upload the entire file, or split the file into multiple byte ranges, as long as the maximum bytes in any given request is less than 60 MB.

The size of each chunk MUST be a multiple of 320 KB (327,680 bytes) except the last chunk. Using a fragment size that does not divide evenly by 320 KiB will result in errors committing some files.

Run the below code to upload the file in a single chunk (less than 60 MB file).  If you have large files then repeat the below request until you upload all the chunks with appropriate Content-Range.
String access_token= 'access_token';
Blob file_body = Blob.valueOf('Hello World!');
String fileLength = String.valueOf(file_body.size());
String uploadUrl = 'upload URL from create an upload session';
Http h = new Http();
HttpRequest req2 = new HttpRequest();
req2.setHeader('Authorization', 'Bearer '+ access_token);
req2.setHeader('Content-Length',fileLength);
req2.setHeader('Content-Range','bytes 0-'+(Integer.ValueOf(fileLength) - 1)+'/'+fileLength);
req2.setHeader('Accept', 'application/json');
req2.setMethod('PUT');        
req2.setEndpoint(uploadUrl);
req2.setBodyAsBlob(file_body);
HttpResponse res = h.send(req2);
System.debug('Response Body: ' + res.getBody());


If you have any other queries/issues drop me an email(rajesh@ibirdsservices.com).

Thanks,
Rajesh K

Salesforce and Mulesoft Integration Workshop

Hi All,
As always, at iBirds Services, we do time to time #iTW sessions. Last weekend we had #iTW session on #salesforce and #mulesoft integrations. He had a workshop at our office, and here are the recorded sessions for this event.
(We have blurred few parts due to personal credentials hiding needs)

Salesforce and Mulesoft workshop part 1



Salesforce and Mulesoft workshop part 2



For any questions and feedback, email to me (aslam.bari@ibirdsservices.com)

Thanks
Aslam Bari

Salesforce Quick Change Set Tool

This tool is native  (Apex / Visual Force) based screen. It helps user to upload their Changeset CSV component files at one shot from this screen. It helps users to avoid adding multiple items in changeset with traditional long efforts.

You can install this tool from this un-managed package as well:
https://login.salesforce.com/packaging/installPackage.apexp?p0=04t1U000006d5gj



Prerequisite

You need to first add your "Quick Change Set" page URL domain into remote site settings

Steps

  • Open the Tab "Quick Change Set", it will open the "QuickChangeSet" page
  • On the screen, it will ask three inputs
    •   Input file: This is the CSV file for the changeset. Here is the https://github.com/ibirds-github/Quick-Change-Set/blob/master/csv-example.csv
    •   NOTE: CSV file format and sequences of columns MUST be same as given in csv file.
    •   Change Set Id: To get this from your org
      •     Open your changeset which you created
      •     Click on "Add" button, right click on anywhere from the page to check inspect elements or open the View Source Code window
      •     Grab the "id" of changeset from this source code
    •   Confirmation Token: To get this from your org
      •  From the source code window which you opened in above step, get the value from "_CONFIRMATIONTOKEN" input tag
  • Click on "Upload File" button to parse this file. It will show all possible components in bottom table with links. You can click on any output component to go directly to setup record for that component
  • Click Confirm Submit to execute the script. It will start adding components into your salesforce changeset
  • Once completed, it will show a success message with changeset link
  • For more info: Watch Here

Supported Components and Rules to mention in CSV file

For now we are supporting following components. In near future, we need to support more. All names must be case sensitive and must exact match to salesforce Name/DeveloperName exact case
  1. Apex Classes -- API name of apex class
  2. Apex Triggers -- API name of apex trigger
  3. Visualforce Pages -- API name of page
  4. Visualforce Components -- API name of VF components
  5. Email Templates -- Email Template Name 
  6. Static Resources -- API name of static resource
  7. Custom Objects -- API name of object
  8. Custom Fields -- [API name of object].[API name of field]
  9. Workflow Rules -- [API name of object].[Rule Name]
  10. Email Alerts -- API name of email alert
  11. Field Updates -- Name of the field update
  12. Custom Labels -- API name of custom field
  13. Record Types -- [API name of object].[DeveloperName of record type]
  14. Page Layouts -- [API name of object].[Name of the layout]


Known Issues

  1. More validations needed on front end side
  2. Error handling needed. Right now there is no way to check if a component is added in changeset properly or not. It always shows success message
  3. File input required validation needed
  4. Few variables may not be useful or can be removed
  5. Getting Changeset Id and Confirmation token is from User Input. There seems to be no way to get this dynamically right now.
  6. Delete functionality is not given in this tool for now.
  7. CSV file format must be same as given in demo file and columns must be in given sequences only
  8. This tool is tested on classic salesforce only so far. Not sure how it will work on lightning UI. Need to do couple of changes to support lightning UI
  9. All names must be exact same as appear in salesforce (Case Sensitives)
  10. In Display output table, it does not show "__c" in object/field names

Resources





Please comment about your views on this tool. If you want to contribute to enhance this package/library then email me : aslam.bari@ibirdsservices.com

Thanks
Aslam Bari
www.ibirdsservices.com

Salesforce Lightning Web Components


Hi All,

Today I will talk about Lightning Web Components, which will be generally available in February 2019 and will run in any Salesforce Org.
Introduction

Lightning Web Components is a new programming model for building Lightning components. It holds web standards breakthroughs, can interoperate with the Aura programming model and delivers unique performance. To create and develop Lightning Web Components, you need to set up “Salesforce DX”.and “Visual Studio” code editor, which is the recommended Salesforce development environment. Here are the installation links:


Command Line Interface (CLI) :

https://developer.salesforce.com/tools/sfdxcli
Visual Code Studio :
https://code.visualstudio.com/download

-Now we need to Install below Visual Code Studio Extensions

  1. Salesforce Extension Pack
  2. Lightning Web Components
  3. Salesforce CLI Integration.
-Now we also need to run below commands in “Visual Studio” terminal. Here are the commands:
  1. sfdx plugins:install salesforcedx@pre-release
  2. sfdx plugins:install salesforcedx@latest
Now, we can run “sfdx plugins” command for check the installed plugins.

It should be show result like “salesforcedx 45.0.12 (pre-release)” it.

- Now, we are ready to create new lightning web component. First of all, we need to create new “Developer Edition Pre-Release Org”. Here is the creation link:


- Now, we need to create a new “Salesforce DX” project in our local machine. Here are the steps:


SFDX Project Creation Steps :

  1. In Visual Studio code, press Command + Shift + P on a Mac OR Ctrl + Shift + P on Windows.
  2. Type SFDX: Create Project.
  3. Enter MyLightningWebComponent as the project name, press Enter.
  4. Select a folder to store the project.
  5. Click Create Project.
- Now, we need to follow required steps to connect “Visual Studio” project with our Salesforce org.

  1. In Visual Studio code, press Command + Shift + P on a Mac OR Ctrl + Shift + P on Windows.
  2. SFDX: Authorize a Dev Hub: This step is used for login our pre-release Devhub Org.
  3. SFDX: Create a Default Scratch Org: We need to create new scratch org for pushing our changes from our local machine into scratch org.
  4. SFDX: Create Lightning Web Component: Now we need to create new lightning web component under “lwc” folder.
Now we will create a Lightning Web Component named ‘contactSearch’


Here’s the code:-

contactSearch.html


1:  <template>  
2:    <lightning-card icon-name="custom:custom57">  
3:      <div slot="title">  
4:        <lightning-layout vertical-align="center">  
5:          <lightning-layout-item>  
6:            Contact Search  
7:          </lightning-layout-item>  
8:          <lightning-layout-item padding="around-small">  
9:            <c-nav-to-new-record></c-nav-to-new-record>  
10:          </lightning-layout-item>  
11:        </lightning-layout>  
12:      </div>  
13:      <div class="slds-m-around_medium">  
14:        <lightning-input type="search" onchange={handleKeyChange} class="slds-m-bottom_small" 
15:           label="Search"></lightning-input>  
16:        <template if:true={contacts}>  
17:          <template for:each={contacts} for:item="contact">  
18:            <c-contact-tile key={contact.Id} contact={contact}></c-contact-tile>  
19:          </template>  
20:        </template>  
21:      </div>  
22:    </lightning-card>  
23:  </template>  

contactSearch.css

1:  lightning-input,  
2:  c-contact-tile {  
3:    position: relative;    
4:    border-radius: 4px;  
5:    display: block;  
6:    padding: 2px;  
7:  }  
8:  c-contact-tile {  
9:    margin: 1px 0;  
10:  }  
11:  lightning-input:before,  
12:  c-contact-tile:before {  
13:    color: #dddbda;  
14:    position: absolute;  
15:    top: -9px;  
16:    left: 4px;  
17:    background-color: #ffffff;  
18:    padding: 0 4px;  
19:  }  

contactSearch.js

1:  import { LightningElement, track } from 'lwc';  
2:  import findContacts from '@salesforce/apex/ContactController.findContacts';  
3:  /** The delay used when debouncing event handlers before invoking Apex. */  
4:  const DELAY = 350;  
5:  export default class ContactSearch extends LightningElement {  
6:    @track contacts;  
7:    @track error;  
8:    handleKeyChange(event) {  
9:      // Debouncing this method: Do not actually invoke the Apex call as long as this function is  
10:      // being called within a delay of DELAY. This is to avoid a very large number of Apex method calls.  
11:      window.clearTimeout(this.delayTimeout);  
12:      const searchKey = event.target.value;  
13:      // eslint-disable-next-line @lwc/lwc/no-async-operation  
14:      this.delayTimeout = setTimeout(() => {  
15:        findContacts({ searchKey })  
16:          .then(result => {  
17:            this.contacts = result;  
18:            this.error = undefined;  
19:          })  
20:          .catch(error => {  
21:            this.error = error;  
22:            this.contacts = undefined;  
23:          });  
24:      }, DELAY);  
25:    }  
26:  }  

contactSearch.js-meta.xml:

1:  <?xml version="1.0" encoding="UTF-8"?>  
2:  <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">  
3:    <apiVersion>45.0</apiVersion>  
4:    <isExposed>true</isExposed>  
5:    <targets>  
6:      <target>lightning__AppPage</target>  
7:      <target>lightning__RecordPage</target>  
8:      <target>lightning__HomePage</target>  
9:    </targets>  
10:  </LightningComponentBundle>  

Now we will create a Lightning Web Component named ‘contactTile’

contactTile.html :
1:  <template>  
2:    <lightning-layout vertical-align="center">  
3:      <lightning-layout-item>  
4:        <img src={contact.Picture__c} alt="Profile photo">  
5:      </lightning-layout-item>  
6:      <lightning-layout-item padding="around-small">  
7:        <a onclick={navigateToView}>{contact.Name}</a></p>  
8:        <p>{contact.Title}</p>  
9:        <p>  
10:          <lightning-formatted-phone value={contact.Phone}></lightning-formatted-phone>  
11:        </p>  
12:      </lightning-layout-item>  
13:    </lightning-layout>  
14:  </template>  

contactTile.css:

1:  img {  
2:    width: 60px;  
3:    height: 60px;  
4:    border-radius: 50%;  
5:  }  

contactTile.js

1:  import { LightningElement, api } from 'lwc';  
2:  import { NavigationMixin } from 'lightning/navigation';  
3:  //import getSingleContact from '@salesforce/apex/ContactController.getSingleContact';  
4:  export default class ContactTile extends NavigationMixin(LightningElement) {  
5:    @api contact;  
6:   // @wire(getSingleContact) contact;   
7:    navigateToView() {     
8:     this[NavigationMixin.Navigate]({  
9:      type: "standard__recordPage",  
10:        attributes: {  
11:          objectApiName: "Contact",  
12:          actionName: "view",  
13:          recordId: this.contact.Id,  
14:        },  
15:      });  
16:   }    
17:  }  

contactTile.js-meta.xml:

1:  <?xml version="1.0" encoding="UTF-8"?>  
2:  <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">  
3:    <apiVersion>45.0</apiVersion>  
4:    <isExposed>false</isExposed>  
5:    <targets>  
6:      <target>lightning__AppPage</target>  
7:      <target>lightning__RecordPage</target>  
8:      <target>lightning__HomePage</target>  
9:    </targets>  
10:  </LightningComponentBundle>  

Now we will create a Lightning Web Component named ‘navToNewRecord’

navToNewRecord.html:
1:  <template>  
2:      <lightning-button label="New Contact" variant="brand" class="slds-m-around_medium" 
3:      onclick={navigateToNewContact} ></lightning-button>  
4:  </template>  

navToNewRecord.js:

1:  import { LightningElement } from 'lwc';  
2:  import { NavigationMixin } from 'lightning/navigation';  
3:  export default class NavToNewRecord extends NavigationMixin(LightningElement) {  
4:    navigateToNewContact() {  
5:      this[NavigationMixin.Navigate]({  
6:        type: 'standard__objectPage',  
7:        attributes: {  
8:          objectApiName: 'Contact',  
9:          actionName: 'new',  
10:        },  
11:      });  
12:    }  
13:  }  

navToNewRecord.js-meta.xml

1:  <?xml version="1.0" encoding="UTF-8"?>  
2:  <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="navToNewRecord">  
3:    <apiVersion>45.0</apiVersion>  
4:    <isExposed>true</isExposed>  
5:    <targets>  
6:      <target>lightning__AppPage</target>  
7:      <target>lightning__RecordPage</target>  
8:      <target>lightning__HomePage</target>  
9:    </targets>  
10:  </LightningComponentBundle>  

Here’s the GitHub link for further files which are required before pushing to scratch org for this tutorial

https://github.com/jaiaswani10/lightning-web-components
Files which are required:-
Picture__c.field-meta.xml file for creating a custom field
lwc.permissionset-meta.xml file for assigning permission
‘data’ named the folder for loading data

Push to a Scratch Org

Type :SFDX: Push Source to Default Scratch Org by using Ctrl + Shift + P  OrType in terminal
sfdx force:source:push [-u<Username>]

Assign the lwc permission set to the default user:

sfdx force:user:permset:assign -n lwc

Load sample data:

sfdx force:data:tree:import --plan ./data/data-plan.json

Add Component to App in Lightning Experience

  1. Type SFDX: Open Default Org.
  2. Click the app launcher icon App Launcher to open the App Launcher.
  3. Select the Sales app.
  4. Click the gear icon Setup Gear to reveal the Setup menu, then select Edit Page.
  5. Drag the contactSearch Lightning web component from the list of custom components to the top of the Page Canvas.



Deploy it to your Pre-release org:
Log in to your Pre-Release org and create an alias for it.
To deploy we have to also push further files which I’ve mentioned above
Type the following commands in VS Code terminal:
sfdx force:auth:web:login -a MyOrg
Confirm that this org is available:
sfdx force:org:list
Deploy your code to Pre-Release org
sfdx force:source:deploy -p force-app  -u MyOrg
Assign the lwc permission set to the default user:
sfdx force:user:permset:assign -n lwc -u MyOrg
Load sample data:
sfdx force:data:tree:import --plan ./data/data-plan.json -u MyOrg
Run your org  and interact with the app:
sfdx force:org:open -u MyOrg
Thanks,

How I prepared for Salesforce certified app builder exam


How I prepared for Salesforce certified app builder exam




Hi All,

On 31st August 2018 I cleared Salesforce Platform App Builder Certification exam. And as soon I posted on social media I started to get question regarding the preparation that how I prepared, So finally I am writing my all the steps I took for this certification. Before starting I would like say a big thanks to my collegues and mentors(Aslam Bari , Ranu Bari , Naveen Soni) for motivating and guiding me for this exam.

When I decided for App builder exam, I got a very first question asked from my friends that, you are a developer then why you are going for this certification. You must go for Platform Developer2.So here is answer for all.
                      
As we all know salesforce provides so many out of the box No Code  tools, using them we can complete so many business requirements.We do not need to write a single line of code. So being a developer I should be having knowledge about these tools,becasuse it can save my efforts and increase my work efficiancy, and I was having that much knowledge. Then Why should not I appear in exam and get my skills certified from the salesforce. It was not wasting money/time. It was an investment so I did it.

So let’s start talking about exam. I took around 25 to 30 Hours in preparation of exam.
First of all I took a deep review of official exam guide, and analysis about which section cover higher ratio of question in exam and how much I am confident in that. So if you see the exam guide you will see that these are the topic which covers more then 70% of exam. And to clear exam you need only 63%.

Data Modeling And Management(20%)
Security(10%)
Business Logic And Process Automation(27%)
User Interface (14%)

You need to focus more on these topics. Most the question for these topics will be scenario based question. While answering the question remind the consideration for every option. It will help you to eliminate the answer so you can select the right answers.

There are some another topic also
Salesforce fundamentals(8%) : In this section very basic questions would be there, Such as a scenario will be given and you need to identify that should you search for a solution on appexchange.

Social (3%): 1 or 2 question would be in exam.

Reporting(5%): Read about the report types and standard reports available. Which reports are available for chart.

Mobile(5%): Read about the customize saleforce mobile app. Such as navigation, buttons on detail page etc.

App Devlopment(8%): Difference between managed and unmanaged package, when to use change set and when to use other migration tools.

Here are some other steps which I took.

  • Also read about the consideration about process automation tools, lookup/master detail fields, formula fields , roll upsummary. So you can understand when not to use them.

  • I also used an mobile app cram which was suggested by one of my Salesforce Ohana friend Bharat Kumar. On this app you will find flash cards , which are helpful for revising the topics. I used to do practice on this app before going to bed. And it was really helpful. I would like to say a big thank to Bharat for letting me know about this app.

Thanks,
Let me know your suggestions in comment section.