GithubHelp home page GithubHelp logo

packtsurabhi / learning-salesforce-lightning-application-development Goto Github PK

View Code? Open in Web Editor NEW

This project forked from packtpublishing/learning-salesforce-lightning-application-development

0.0 0.0 0.0 3.89 MB

CSS 4.20% JavaScript 78.98% Apex 16.53% HTML 0.30%

learning-salesforce-lightning-application-development's Introduction

Learning Salesforce Lightning Application Development

b05909_mockupcovernew

Requirements

Download Salesforce CLI from https://developer.salesforce.com/tools/sfdxcli

IDE Recommended

Use visualstudio code editor (https://code.visualstudio.com/)

Install SFDX Plugin from salesforce on VisualStudio Code(https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode)

Dev, Build and Test

Clone the current repository from git and CD into the project root

Example to push all code from chapter 1 to scratch org start by changing directory using cd chapter1 and then following below commands

Autheticate to Devhub

Authenticate to the DevHub using the below command

$ sfdx force:auth:web:login -d -a DevHub

Set your Devhub as default Dev hub globally .You will need to knpw your Devhub Username/alias for this

$ sfdx force:config:set defaultdevhubusername=DevHub -g

Create a scratch org

## create a scratch org for this branch . Total of 30 days for the scratch org created
$ sfdx force:org:create -s -f config/project-scratch-def.json -d 30 -a scratch_org

Set default scratch org

$ sfdx force:config:set defaultusername=scratch_org

Push local code artifacts to scratch org

$ sfdx force:source:push

Open scratch org

$ sfdx force:org:open

Push source from local folder to the scratch org if local file changes

$ sfdx force:source:push

Pull source from scratch org to the local folder if you make any code and config changes in scratch org

If you are doing any dev in scratch org including config and set up you can pull in your local src folder using below

$ sfdx force:source:pull

Convert SFDX format to metadata for Deployment To Dev orgs(Non Scratch orgs)

For this one will have to first authenticate to the Dev org where the Source Code will be deployed

Run the below command for authenticating to Devorg

$ sfdx force:auth:web:login -d -a Devorg

Once authenticated to push the source code to the Devorg run the below command.

The below converts the source to the Metadata API format from DX source format

$ sfdx force:source:convert  -d mdapi_output_dir

Deploy the code to the Devorg

$ sfdx force:mdapi:deploy --deploydir mdapi_output_dir -u Devorg -w 3 --testlevel RunAllTestsInOrg

Deleting a scratch org

Your scratch can be available for 30 days and there is no need for them to delete .However if you have too many scratch orgs and running out of limits you can delete it using the below command . You will need username or the alias .

$ sfdx force:org:delete -u <username/alias>

Open Current Directory in VSCode Editor

$ code .

Resources

CLI reference Guide (https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference.htm)

SFDX Developer Guide

https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_develop.htm

Description of Files and Directories

Issues

1 . ERROR: entity type cannot be inserted: Scratch Org Info.

This is because your user in the DevHub org does not have the DevHub Permission set assigned .Request your salesforce admin to give you access to this permission set in your DevHub org .

learning-salesforce-lightning-application-development's People

Contributors

arunpackt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.