Skip to content

Create new task


Use cases

You use this command when you want to :

  • Create a dedicated new branch
  • Create a scratch org linked to the branch OR assign a dedicated sandbox to the newly created branch

Sandbox or scratch org ?

With SFDX, usually each member of the teams has its own sandbox or scratch org to work on it.

The release manager of the project can tell you if you work with scratch orgs or source-tracked sandboxes, and which sandbox to use if you are in sandbox mode.


Source-tracked sandbox mode

Pre-requisites (sandbox)

You need credentials to login on the source-tracked sandbox you'll work with. It can be:

  • An existing source-tracked sandbox
    • Existing source-tracked sandboxes must be refreshed from time to time to avoid too many conflicts, discuss with your Release Manager !
    • Release managers: When you create or refresh a sandbox, you can easily activate invalid users with a few clicks
  • A new source-tracked sandbox that you can create from production org

It is recommended to create sandbox from the org that is related to the target git branch.

Start new task on sandbox

Select sandbox

  • Open VsCode SFDX Hardis extension by clicking on Hardis Group button in VsCode left bar (loading can task several seconds)
  • Click on Start a new task
  • Answer the questions then select Sandbox when prompted
    • If the sandbox is not proposed in the list, select the option to authenticate to your desired sandbox

Update your sandbox ?

  • When prompted if you want to update your sandbox:
    • Select yes only if you have NO pending work in your sandbox that you'll want to publish later
      • If the update script fails, you can manually deploy single metadatas using Right click -> Deploy to org (see screenshot below)
    • Otherwise, select no

Example of manual deploy of a metadata that you think could have been updated in parent branch, after an Update sandbox failure

Work

  • At the end of the script execution:

    • If you want to reset the sandbox tracking (meaning you don't care about the previous updates in your sandbox), you can click on command
    • Click on Open org in browser and you can start working in it :)

Under the hood Under the hood

See details in hardis:work:new command documentation


Scratch Org mode

Pre-requisites (scratch org)

You need the credentials to login on the Dev Hub Org (usually the production environment)

Start new task on scratch org

  • Open VsCode SFDX Hardis extension by clicking on Hardis Group button in VsCode left bar
  • Click on Start a new task
  • Answer the questions then select Scratch Org when prompted
    • If the sandbox is not proposed in the list, select the option to authenticate to your desired sandbox
  • Wait for the sandbox creation script to be completed, and you can start working in it :)
    • If you see errors while creating the sandbox, request support from the project release manager

Under the hood Under the hood

See details in hardis:work:new command documentation