Tuesday, October 5, 2021

Steps to create and login to scratch orgs in salesforce

How to create scratch orgs,what is devhub. 1. Enable devhub 2. first command from pallete,authorise a devhub org, 3. come to vs terminal 4. List all your orgs sfdx force:org:list --all 5. Create scratch org sfdx force:org:create -f config\project-scratch-def.json --setalias scratch1 --durationdays 7 --setdefaultusername -"naren_cam" --json --loglevel fatal 6. sfdx force:org:list --all list your org to see your scratch org user ALIAS USERNAME ORG ID STATUS EXPIRATION DATE ─── ─────── ───────────────────────────── ────────────────── ────── ─────────────── (U) ren_cam test-5althihwsdlr@example.com 00D1y0000000wetEAA Active 2021-09-03 7. Generate password for scratch or user sfdx force:user:password:generate -u test-5althihwsdlr@example.com 8. View details of scratch org user sfdx force:user:display -u test-5althihwsdlr@example.com 9. Login to scratch org url with credentials