Custom Lightning Page Template / Layout

In this blog, I would like to discuss you about how to create a custom lightning page template or layout using SFDX.

Create Lightning component

Lightning component resides inside a lightning project so create a project and follow the below steps. If you are not aware of project creation then go through my blog.

  • Create a lightning component in Visual Studio Code
    • sfdx force:lightning:component:create -n <component name> -d <location>
    • Modify the design page to show the custom attribute in the layout selection or page layout editor

Push Code into scratch Org

  • Create a scratch org
    • sfdx force:org:create -s -f config/project-scratch-def.json -a <alias name>
  • List all connected orgs including scratch org with Visual Studio Code
    • sfdx force:org:list –all
  • finally, push the code into scratch org created

Create a page named My Bike  in the Lightning App Builder.

  • Go to setup –> Lightning App Builder -> New
  • Select App Page in the options
  • Then, fill the field with your Page name and click Next
  • Select your custom or standard layout
  • Our custom three column layout displayed under Custom section
  • Then, Click Finish button to include the custom or standard component in the layout
  • Click Save and Activate your page to the preferred profiles and apps

 

https://developer.salesforce.com/docs/component-library/bundle/lightning:appHomeTemplate

Each template component should implement only one template interface. Template components shouldn’t implement any other type of interface, such as flexipage:availableForAllPageTypes or 

force:hasRecordId. A template component can’t multi-task as a regular Lightning component. It’s either a template, or it’s not.

Advertisements

Configure Salesforce Developer Experience (SFDX) on Visual Studio Code

 

posterIn this blog, I would like to share the steps for configuring Salesforce Developer Experience (SFDX) in my favourite code editor Visual Studio Code for enabling Source Driven Development model. Salesforce DX supports the traditional application development experience with debugging (specifically on apex), CLI (Command Line Interface) Support along with Visual Studio Code.

Continue reading

10 Years Later, Salesforce Introduced the Apex Switch Statement in Summer 2018 Release

Poster 2 basic

This will be a glad news for all salesforce developers who were looking for an apex switch statement for decades to simplify most of the lengthy apex statements. Exactly 10years back there has been an Idea posted on the Idea exchange for this.

IdeaExchange Link – https://success.salesforce.com/ideaView?id=08730000000BrSIAA0

Continue reading