Build a Salesforce DX Plugin in 15 Min – Dreamforce 2018

Build a Salesforce DX plugin in Dreamforce 2018 within 15 minutes

Before deploying metadata in Sandbox of production, have you felt that how great it would be to generate configuration workbook ? Or compare sandboxes for difference ? Or check if fields are used on any page layouts or not ? Dear reader, you are in need of custom Salesforce DX plugin.

You heard it right, Salesforce DX allows custom plugin development. So now question is, how do you connect to Salesforce Org ? Do you need to know about OAuth or Single Sign On (SSO) ?

Give your 15 minutes to me & Abhishek in Dreamforce and we would show tricks and basics of building Salesforce DX in snap of the fingers. Make sure to add this session in your agenda.

Not coming to Dreamforce ? No worries, come back on this post and I would share complete source code and how plugin can be built in 15 minutes.

Read Query Parameter in Lightning Component

Launch Lightning Component using formula field and also read query parameter in Salesforce Lightning Component

Before Summer 18, to read parameter in Lightning Component, we had to wrap Lightning Component in Lightning Application. After Summer 18, it has changed for good.

In this blog post we would create a formula field to launch Lightning Component (yes, you read it right). And then we would read URL parameter in Lightning Component using pageReference provided by interface lightning:isUrlAddressable.

Create a formula field on Account to launch Lightning Component and read its parameter. Continue reading “Read Query Parameter in Lightning Component”

Frequently Used Git Commands

Author posted by Jitendra on Posted on under category Categories Tech Tips and tagged as Tags with 1 Comment on Frequently Used Git Commands

Most frequently used Git commands by developers

Set Git to store credentials

Below command can be executed from anywhere in your system.

git config --global credential.helper wincred

Turn off Warning _LF will be replaced by CRLF_

git config core.autocrlf true
or
git config --global core.autocrlf true

In Unix systems the end of a line is represented with a line feed (LF). In windows a line is represented with a carriage return (CR) and a line feed (LF) thus (CRLF). when you get code from git that was uploaded from a unix system they will only have an LF. Continue reading “Frequently Used Git Commands”

Summary of Attachment, Document, Content Library and Files in Salesforce

Comparing between Attachment, Document, Content Library and Files in Salesforce

Summary :

  • Files is new way to store file in Salesforce
  • Content from external file service like Google, Box appears in Files
  • Files from Content Library displayed in file
  • CRM Content Library cannot be created in Lightning experience yet
  • Attachment and Files are two different objects, so two different related lists.
  • Attachment can be viewed in Lightning in Notes & Attachment related list
  • Attachments cannot be created in Lightning Experience, we should not use Attachments in future
  • To migrate existing Attachment to Files, use this AppExchange from Salesforce Labs
  • Document tab is not available in Lightning Experience
  • Documents should be replaced by File
  • Files yet does not support being used as attachment in Email Templates. If you are using Document in Email template, then keep it in Document
  • CRM Content delivery not available in Lightning but File can be shared with external user using Link
  • External user can only view or download file but cannot edit or update
  • File supports versioning
  • File can be related with multiple records.
  • File supports granular level sharing. It would be shared with anyone who has access to parent record. If you want to share with broad audience, it can be shared on chatter.

Continue reading “Summary of Attachment, Document, Content Library and Files in Salesforce”

Why Quick Actions are not appearing on Case page layout in Lightning Experience

Solution to make quick actions visible on Case & Work Order Page Layouts in Lightning Experience

If you want quick action to appear on Page layout, all you have to do is add it in Salesforce Mobile and Lightning Experience Actions as shown in below image

Add Quick Actions on Page Layout - Salesforce
Add Quick Actions on Page Layout – Salesforce

Unfortunately this did not worked for Case & Work Order Page layout  in Lightning experience. Continue reading “Why Quick Actions are not appearing on Case page layout in Lightning Experience”

Embed Lightning Component in Flow

Author posted by Jitendra on Posted on under category Categories Salesforce and tagged as Tags , with 5 Comments on Embed Lightning Component in Flow

How to create a lookup field in Flow by embedding Lightning Component

Most of us are big fan of Flow but at the same time we miss a lot of obvious features like lookup fields, model dialogues etc.  This blog post might bring excitement and motivation to give more attention and love to Flow.

Around 3 years back, I had written a post on how to create a lookup component in Flow. That solution was just a workaround without user friendly experience. Lets focus on better user interface today, In this post we will give lookup field ability to flow by simply reusing existing Lightning Component.

Click here for animated image showing Flow in action supporting Lightning Component.

First and foremost, make sure you enable Enable Lightning runtime for flows by navigating to Workflow | Process Automation Settings , Otherwise flow would not run in classic runtime environment. Continue reading “Embed Lightning Component in Flow”

Using SalesforceDX (SFDX) with non Scratch Orgs

Author posted by Jitendra on Posted on under category Categories Salesforce and tagged as Tags , with 10 Comments on Using SalesforceDX (SFDX) with non Scratch Orgs

How to use SalesforceDX (SFDX) with Sandbox, Developer and Production Orgs

We have gone through few blog posts about SFDX and its capabilities in past. In this post, I will explain steps on how to use SFDX with developer, Sandbox or Production Org. In short we will discuss how to use SFDX with non Scratch Orgs. We would be using official Salesforce IDE for SFDX, which is VSCode.

Assumption – VSCode extension is already installed in your VSCode.

  1. Create SFDX project in VSCode

Open VScode and press cmd+Shift+p, It will give some option. Select SFDX: Create Project.

SFDX : Create Project
SFDX : Create Project

Continue reading “Using SalesforceDX (SFDX) with non Scratch Orgs”

What is Micro Services

Author posted by Jitendra on Posted on under category Categories Tech Tips and tagged as Tags with 1 Comment on What is Micro Services

I have read many posts and watched video to understand Microservices precisely however I found Martin Fowler’s explanation about Microservices most helpful. This blog post is just the recap & summary of what I understood about Microservices  Architecture.

Characteristics of Microservices

  1. Build services in form of Components
    • Components can be independently replaceable and upgradable
    • Components can be combination of Libraries and Services
    • Services can be built in other languages and services can inter communicate
  2. Organized keeping business rules in mind
    • Traditionally (Monolithic), Services were organized considering technical aspects like different services related to UI, Database, Server etc
    • Microservices, suggests to group it as per business capabilities like shipping, Order, Catalog etc
  3. Smart end points and dump pipe
    • In ESB (aka spaghetti box 😉 lol), we tend to add all smartness in ESB itself and endpoint is just a dump where consumer gets preprocessed data
    • MicroServices on other hand encourages dump pipe (ESB) and smart endpoints
    • Micro Services Smart Endpoints

  4. Decentralized Governance or Data Governance
    • Every Service should be responsible for their own database & persistence
    • Can’t communicate to other databases directly, it should be via API’s only (These are mostly inspired by Amazon’s 2 Pizza team size)
    • Every service can have different languages or tools
  5. Infrastructure Automation
    • Continuous Delivery is very important for each services to make sure there is no or minimal down time
    • Top class monitoring capabilities to perform analysis of degraded performance or downtime
    • Important to have roll back plan and ability to spin up new server in case of service or service fail
  6. Design for failure
    • As there could be many microservices, its inevitable that they would fail.
    • Companies like Netflix, they have a application (chaos monkey) which randomly goes out and fail their microservices deliberately
    • Its important to perform these kind of exercises to understand how resilient their network and microservices are.

Continue reading “What is Micro Services”