15

Just run the following command: sfdx force:package:installed:list -u <alias|username> This will give you all of the packages installed, including the 04t "AllPackageVersion" Id that you need to install an app. Sample output: === Installed Package Versions [4] ID PACKAGE ID PACKAGE NAME NAMESPACE ...


15

Yes, you can disable caching in scratch org by specifying S1EncryptedStoragePref2 as disabled org preferences in your scratch org definition file. { "orgName": "DevOrg", "edition": "Developer", "orgPreferences" : { "enabled": ["S1DesktopEnabled"], "disabled": ["S1EncryptedStoragePref2"] } } Thanks René Winkelmeye for this ...


14

In the project configuration file, specify the namespace. { "packageDirectories" : [ { "path": "force-app", "default": true} ], "namespace": "myns", "sfdcLoginUrl" : "https://login.salesforce.com", "sourceApiVersion": "44.0" } This really only alluded to in the documentation, but sfdx-project.json is the key to creating a scratch org with a ...


13

Ended up realizing orgPreferences are different than features. So the definition ended up looking like this: { "orgName": "Company", "edition": "Enterprise", "features": ["PersonAccounts"] }


12

Here are those I could find: AnalyticsSharingEnable (available in version 40.0 and later) Turn On Enhanced Folder Sharing for Reports and Dashboards (?) Use Your Salesforce Sharing Settings in Wave AsyncSaveEnabled (available in version 40.0 and later) Enabling Asynchronous API ChatterEnabled Chatter Settings EnhancedEmailEnabled Considerations for ...


11

The sfdx force:org:display command can also show the expiration date: david$ sfdx force:org:display -u test-<snipped>@example.com === Org Description KEY VALUE ─────────────── ──────────────────────────────────────────────────────────────────────────────────────────────────────────────── Access Token <snipped> Client Id ...


10

Scratch Orgs are deleted asynchronously after you run the delete command (or it expires). It will take some time for that username to be freed up, probably at least 24 hours. You'll need to use a different user name in this case, as there's nothing you or Support can do. In the future, rename the user before deleting the org if you wish to reuse the user ...


10

The SourceMember sObject is only present in scratch orgs. Its presence would be a sign that you are in a scratch org. The gotcha would be that it is only accessible via the Tooling API and not Apex alone. https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_sourcemember.htm


10

I can answer some of these I think. At least we are now creating new unlocked package versions and promoting them. Our unlocked package version does depend on two managed packages. 1 - Does SF use some internal/hidden scratch org to actually deploy package code there - to make sure that apex code and sobjects are valid? Yes, as on the reference docs "...


9

An up-to date way of matching the OrgPreferenceSettings list is using the Settings metadata. Using heroku/force CLI that would be: force fetch -t Settings Now you can search in the different settings metadata files for your org's preferences. For example: Accounts.settings contains the enableAccountTeams tag that would be translated ...


9

This feature was added in Summer '19 (release notes) In your scratch org definition file (e.g. project-scratch-def.json) { "orgName": "Example", "edition": "Enterprise", "release": "Preview" // Preview, Current or Previous }


8

I use this line in .forceignore for that: force-app/main/default/profiles The path should be relative to where your .forceignore lives


8

In addition to @sfdcfox response (which is technically accurate) , I suggest you do not try to reuse the same username in different scratch orgs, this seems a very bad habit and all your project orgs may get quickly messy, even more if you use CI. You could for example use some suffix for your scratch org usernames, using your project name and the creation ...


8

Scratch orgs are intended to be throw-away and have a limited life span of at most 30 days. Instead of trying to re-use a scratch org you should throw it away and build a new one.


8

On inspection I saw that the POD (instance) on which my scratch orgs exist had been upgraded to Spring '20 on Saturday. The only solution I could find was to delete my scratch orgs and re-create them using the original aliases. Having done this the problem went away. I guess Spring '20 doesn't play nice with Winter '20 scratch orgs.


7

You're probably trying to create it using your project.json. Try using a project scratch definition file. The file you're referencing sfdx-project.json should look somethign like this { "orgName": "Demo Company", "edition": "Developer", "orgPreferences" : { "enabled": ["S1DesktopEnabled"] } } usually it's called project-scratch-def....


7

As per Enable the Dev Hub in Your Org: Enabling Dev Hub in a production or business org is completely safe and won’t cause any performance or customer issues. The Dev Hub is comprised of objects with permissions that allow admins to control the level of access available to a user and an org. and After you enable the Dev Hub, you can’t disable it. If ...


7

Figured it out. You cannot use the sfdx force:package:install command using the ID of the appexchange app. The ID that is needed is eventually displayed in the URL during an interactive install of the app into a non-scratch org (at the step where you are asked to select which users should be granted access to the app). For example, the URL for the "...


7

You are not overlooking anything but you are not understanding few concepts on how authentication works between CLI and Salesforce. The machine that creates the scratch can log into that using sfdx force:org:open .Since you never created the org from your local machine this wont show up . Here is what you can do if you want to log into the scratch org ....


7

You apparently misread the error. You've actually reached your active limit, not the daily limit. You would need to delete at least one scratch org before creating another. They don't specify if the daily limit is reset at midnight or rolling, but in your case, it doesn't matter, you simply have too many active scratch orgs in your dev hub. It's ordinarily "...


7

There's no GUI for it, but you can go to the terminal and type in the following command: sfdx force:org:list --clean This will clear up all expired scratch orgs.


7

Automation. Using the CLI means that you can set up entire processes, such as CI/CD (Continuous Integration and Continuous Delivery). For example, you can make a script to create a new scratch org, load all the metadata to that scratch org, and upload new records to use as development data, etc, all in a single step. Advanced Use Cases. The GUI doesn't ...


6

This is in the documentation: Log in to Dev Hub org as the System Administrator or as a user with the Salesforce DX permissions. From the App Launcher, select Active Scratch Orgs. A list of all active scratch orgs is displayed. To view more details about a scratch org, click the link in the Number column. To view the request that was used ...


6

No, scratch orgs are always "empty" when created. They're meant to be populated with metadata from your source code repository, which is the purpose of Salesforce DX. It's not "org-based development", the way that production/sandboxes are, but instead "source code-based development", where all of your configuration is in source control, and that code is the ...


6

You should use Definition File when creating the scratch org to define its shape. Currently preparing the shape definition file is a manual step. There is a pilot program which allows you to export the shape of an org and then you can feed that shape definition when you create the scratch org.


6

Based on Denis's answer, I just went ahead and did the pull with this in .forceignore: **profiles and got this result: === Pulled Source STATE FULL NAME TYPE PROJECT PATH ─────── ──────────────────────────────────────────────── ──────────── ──────────────────────────────────────────────────────────────...


6

This is already possible: You can create a Spring '18 Enterprise Edition Pre-Release org that you'll use as your DevHub to create Spring '18 Scratch Org, as explained by the PM Rohit Mehta here.


6

After org creation you could execute anonymous Apex that sets UserPreferencesLightningExperiencePreferred = false on the User object. You could also open up the scratch org to the URL: /ltng/switcher?destination=classic And then all subsequent requests will open in Classic.


6

This has also been reported on the success community and we are currently looking into the issue. Some things to note: The CLI uses the streaming API (long polling) to be notified when the scratch org is created. If the CLI doesn't get that message, then it will not try to authenticate to the org even if it has been created. We are adding a "last-ditch ...


6

I've logged that bug with the DX team. The solution (for now) is to have an src directory in mdapi format, deploy the "history tracking" flag on the CustomObject first, and then deploy the fields afterwards. sfdx force:mdapi:deploy -d src -w 10 sfdx force:source:push Your src folder would be a traditional package: src/package.xml <Package xmlns="http:/...


Only top voted, non community-wiki answers of a minimum length are eligible