Create a Scratch Org Based on an Org Shape | Developer Quick Takes

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 พ.ย. 2024

ความคิดเห็น • 23

  • @chandu5645
    @chandu5645 ปีที่แล้ว +1

    Thanks. what if the Dev Hub org and source org both are same.?

  • @keviin077
    @keviin077 ปีที่แล้ว +1

    Thanks for the video. Super easy explanation.

  • @emanuelediscala
    @emanuelediscala 10 หลายเดือนก่อน

    Hi thank for video!!
    Just one thing, If i would like to replicate metadata too (obj fields,Lighting App customizzation) would it be possible with a particular way or setup?

    • @AlbaRivasSalesforce
      @AlbaRivasSalesforce 9 หลายเดือนก่อน +1

      The one click experience to replicate metadata is with sandboxes. If you want to replicate metadata in a scratch org, you need to deploy it yourself, with sf project deploy (and you can retrieve the metadata from another org with sf retrieve start, but it always needs a bit of cleanup so it's deployable)

  • @hmayer-hutte
    @hmayer-hutte ปีที่แล้ว +1

    Hi Alba, thanks for sharing, very useful 👏
    I think I've spotted a bug in Org Shape - what is the best place to report it?
    - I use an Org with DevOps Center enabled as my sourceOrg
    - nevertheless, Scratch Orgs created from a Scratch Org Definition File pointing to the respective sourceOrg create with DevOps Center disabled
    - adding explicit properties to enable DevOps Center ("features": ["DevOpsCenter"], "settings": {"devHubSettings": {"enableDevOpsCenterGA": true}},) to the Scratch Org Definition file fixes the problem, however from my understanding of Org Shape those shouldn't be necessary when referencing a sourceOrg, but should be part of the Source Org properties that get implicitly applied to the Scratch Org

    • @AlbaRivasSalesforce
      @AlbaRivasSalesforce ปีที่แล้ว +1

      Thanks for finding that! If you want to follow up the bug, you can log the issue through your sales rep, or if you don't have one, on trailhead.salesforce.com/trailblazer-community/groups/0F93A0000009TPkSAM?tab=discussion. If you're ok with me login it, tell me, and I'll do it internally

    • @AlbaRivasSalesforce
      @AlbaRivasSalesforce ปีที่แล้ว +1

      I got a response! "This is working as designed. The DevOps Center org preference is purposefully toggled off during signup, because Salesforce requires customers to explicitly enable it for legal reasons. Using the scratch org features is the way to create a new scratch org with the DevOps Center enabled. When using those features, Salesforce validates that the Dev Hub org has enabled DevOps Center, as validation that the customer has agreed to the DevOps Center terms and conditions." So, you can use org shape to clone your org, and additionally activate the DevOps center feature in your scratch org definition file. Hope that helps.

    • @hmayer-hutte
      @hmayer-hutte ปีที่แล้ว +1

      @@AlbaRivasSalesforce Thank you very much for following up on this! I wasn't aware that using both Org Shape (sourceOrg) and explicit feature enablement from the same definition file are designed to work, but in the light of the background you've provided it makes perfectly sense!

  • @shubham0071832
    @shubham0071832 ปีที่แล้ว

    If a managed package is installed in Source org so will that be available in the scratch org as well ?

    • @AlbaRivasSalesforce
      @AlbaRivasSalesforce ปีที่แล้ว +2

      That's metadata. Org shape doesn't clone metadata, only the baseline configuration: features, limits, setting, edition

    • @defaultdefault812
      @defaultdefault812 ปีที่แล้ว

      For something like this... You can use the cumulusCI tool.

  • @defaultdefault812
    @defaultdefault812 ปีที่แล้ว

    Can you run a shape file based only on the Dev org? For instance, a trial dev org which has no source org?

    • @AlbaRivasSalesforce
      @AlbaRivasSalesforce ปีที่แล้ว

      My source org indeed was a dev org. You make it a source org by activating the feature on the setup. You need a dev hub, that can be the same dev org, or a different one

  • @keviin077
    @keviin077 ปีที่แล้ว

    Hello all. I'm straggling with one thing. How to authorize previously created Scratch Org by other person or on another computer? What is the command? I'm asking because all solutions which are provided describe the case where authentication is done during the process of new Scratch Org creation. Thanks

    • @AlbaRivasSalesforce
      @AlbaRivasSalesforce ปีที่แล้ว +1

      You can't connect the CLI to a scratch org another user has created. You can create as many scratch orgs as you need, setting up the config in the scratch org def file OR copying a source org shape. Hope that makes sense!

    • @keviin077
      @keviin077 ปีที่แล้ว

      @@AlbaRivasSalesforce Yes & No 🙂So I will describe it by the different way. Steps: 1. I will create new Project with manifest. 2. Authorize the DevHub Org 3. Create a scratch org with (sfdx force:org:create -f config\project-scratch-def.json --setalias Bennenden_scratch_Org_Dev --durationdays 30 --setdefaultusername --json --loglevel fatal). At that point newly created Scratch org is connect. But what if I will lost the whole project? Than I have to create a new one (empty), Authorize the DevHub and now the thing I don't know how now I can authorize Scratch Org created in previous project which still exist. That is what I don't know how to perform.

    • @AlbaRivasSalesforce
      @AlbaRivasSalesforce ปีที่แล้ว

      Scratch orgs are ephemeral and can last at most 30 days. Your code and metadata should be in a git repo, and you should be able to reproduce your whole project in a new scratch org in seconds. You shouldn't need to access a scratch org from another user or from a project that you deleted or something, because everything should live in your git repo. Said that, a way in which you can find which scratch orgs did you create from a dev hub, you can go to the Dev Hub and there is a "Active Scratch Orgs" tab in which they should be listed, however, I don't think you can reauthenticate with that DevHub and use them. See this response salesforce.stackexchange.com/questions/216366/how-can-i-connect-to-a-scratch-org-which-was-newly-created-and-i-only-have-the-u

    • @AlbaRivasSalesforce
      @AlbaRivasSalesforce ปีที่แล้ว

      I don't think you can reauthenticate with that DevHub and use them --> but you can create new ones

  • @preethpr8714
    @preethpr8714 ปีที่แล้ว

    The command force:org:shape:list keeps throwing ERROR running force:org:shape:list: Error authenticating with the refresh token due to: expired access/refresh token .Please assist

    • @AlbaRivasSalesforce
      @AlbaRivasSalesforce ปีที่แล้ว

      It seems that you're not correctly authorized with your dev hub - make sure you are!

    • @AlbaRivasSalesforce
      @AlbaRivasSalesforce ปีที่แล้ว

      Or it may be that you haven't select the correct dev hub as default, as well

  • @mdsobuj969
    @mdsobuj969 ปีที่แล้ว +2

    owo so great ida,, i like it