Hot answers tagged

17

Looks like I have found already a culprit here. It is very important to check sourceApiVersion property of project.json configuration. Looks like this value was 44.0 in my project. Probably because I have created it before updating the salesforce-cli tool. Then I updated the CLI and even reinstalled it but the project version has not been changed. { "...


8

To avoid the error on running sfdx force:source:pull run the following query through the tooling API and delete any records it returns (easily done in Dev Console): SELECT Id, MemberType, MemberName FROM SourceMember WHERE MemberType = 'Workflow' If you have any workflow metadata which you need to retrieve then use sfdx force:source:retrieve to pull these ...


7

Salesforce CLI use an access token to connect to your org. This means that even if you change your password or even your username it will still be connected to your org trough your username. If you want to revoke the access permission you can do it by navigating to Setup>Home>Apps>Connected Apps>Connected Apps OAuth Usage and block the Salesforce CLI app.


4

If the orgs are connected , a better option is to use change set since you can easily detect dependencies and add them . Using sfdx you can use sfdx force:source:retrieve to accomplish this . To retrieve profile you can use below .This also shows how to retrieve apex class and custom object along as well $ sfdx force:source:retrieve -m "ApexClass, Profile:...


4

Sometimes processes fail unexpectedly and leave behind lock files. In most cases you should be able to manually remove the file by navigating to your local AppData folder (the file will live elsewhere on other operating systems) and deleting it from your file manager. Sounds like you've been able to resolve this issue just by removing update.lock.


4

It's a known bug that hasn't been fixed, you can follow progress over here: https://success.salesforce.com/issues_view?id=a1p3A000001SitrQAC EDIT: Fixed as of December 2019


4

This seems to be an issue in the Salesforce CLI plugin for pre-release. I am going to inform the team about it. You can uncover the real error by executing below command sfdx plugins:install salesforcedx@pre-release --log-level=error Here is the original error error Couldn't find any versions for "salesforcedx-templates" that matches "49.0.1-0" ...


3

From the Source code, you can view here The state field maps to one of these, It's the state of the local file when force source pull or push occurs. UNCHANGED: 'u' CHANGED: 'c' DELETED: 'd' NEW: 'n' DUP: 'p' The DUP can be generated when mdapi covert happens and two files with the same name exist. The documented use case is discussed here This is not ...


3

Use the -w parameter so that each command waits for confirmation, and things proceed in order: sfdx force:org:create -w 10 -s -f ./config/project-scratch-def.json -a ScratchOrg sfdx force:package:install -w 10 --package 04t0M000001mF9bQAE sfdx force:package:install -w 10 --package 04tG0000000LKgXIAW sfdx force:package:install -w 10 --package ...


3

"Regular" (Developer Edition) scratch orgs don't have the same feature set as Enterprise Edition orgs, or any arbitrary org. Packaging orgs often have a lot of features turned off, as well, to avoid inadvertent dependencies. That makes pulling Profile metadata out of a scratch org for deployment to a non-scratch org... difficult, in many cases, and Data.com ...


3

It appears you're on a Windows computer. If the restart doesn't solve the issue, I'd check whether you allowed the installer to Set PATH to Salesforce CLI ?


3

Ya, this is most likely from the CLI upgrade, and installing the plugin again probably won't help. It might be because your alias contains .'s in it which I didn't think worked in v6 either. Can you try to update your alias and see if that resolves it? sfdx force:alias:set newAliasWithoutDots=<yourscratchorg> sfdx force:config:set defaultusername=...


2

Trailhead Playgrounds aren't scratch orgs linked to your Dev Hub. They're closer to independent Developer Editions. To authorize them for use with Salesforce DX, you need to first get your Trailhead Playground username and password. Each Playground will have an independent set of credentials. You can then authorize each Playground separately with sfdx ...


2

Metadata API has 2 formats. File-Based Calls CRUD-Based Calls RenameMetadata is crud based called and not File-Based calls. Thus you won't be able to use force.com migration tool aka ANT or workbench for this purpose. The easiest way to use crud based call is to use Metadata API Wsdl. You can download it by navigating it from Setup->API->Metadata ...


2

If You're sure it's installed, restart your computer and try again. installation changes may nor always immediately take effect, and so restarting can make sure all changes are applied.,


2

You have a space in your file path, so the CLI thinks you're trying to add multiple paths. Make sure you either quote: "/Users/salesforceDeveloper/Desktop/SFDC Project/Prod Migration/force-app/main/default/objects" Or backslash escape: /Users/salesforceDeveloper/Desktop/SFDC\ Project/Prod\ Migration/force-app/main/default/objects Or ideally, move the ...


2

The command expects to run in a Unix-like shell (e.g. bash, zsh, etc), but you're using PowerShell. The rm command in PowerShell works differently. In a shell that supports this syntax, it means "--recursive --force", and is meant to delete all matching sub-directories and files, and ignoring permissions errors that can be ignored (such as read-only). ...


2

This is not full code and a pseudo-code at this point but should get you started. This also assumes its a pre-deploy hook for now. Approach 1 - Establish another session using sfdx-core lib You can use the sfdx-core library to use the keys stored in your local machine to easily establish a session. The key here is to note that argv contains all the flags ...


2

OK I figured it out on Mac OSX. For a single file -p works as follows: sfdx force:source:deploy -p "force-app/main/default/layouts/Snapshot__mdt-Snapshot Layout.layout-meta.xml" However, for multiple files with your -p argument, you need to surround each filename with escaped double quotes as follows: sfdx force:source:deploy -p """...


1

You can check the Metadata Coverage Report to figure out the JSON you need to enable specific features. You use this JSON file while creating the Scratch Org: sfdx force:org:create -f config/my-scratch-org-config.json For example: { "settings": { "productSettings": { "enableRevenueSchedule": true } } } You ...


1

Yes, queues are supported. sfdx force:source:deploy -p force-app/main/default/queues The expected file name format is: Default.queue-meta.xml And the expected contents should look like: <?xml version="1.0" encoding="UTF-8"?> <Queue xmlns="http://soap.sforce.com/2006/04/metadata"> <doesSendEmailToMembers>false</...


1

First off, the error message was misleading. A Salesforce developer helped me understand that the tooling api has a slightly different set of configurations, and that is why the package2-description.json was mentioned, even thought it has nothing to do with my sfdx project. Second "If you are going to specify a dependent package by the 04t ID, then do not ...


1

You can use any of the types in the Metadata Types documentation. There is mostly a 1:1 relationship to those metadata types for the force:source:retrieve command. Settings are kind of an exception (e.g. Address Settings would be retrieved using Settings:Address), but I think that's the only one. Edit: Updated Link. The types are located in the left nav ...


1

Look in Setup at the field on My_Custom_Object__c that is a Lookup or Master-Detail to Account. Under Master-Detail Options (or Lookup Options), find the Child Relationship Name. This is what gets suffixed with __r in a parent-to-child query. In this screenshot, the relationship name is Business_Lines: So a parent-child query would look like: SELECT Id, ...


1

This can be done using sfdx source commands. If you are familiar with pushing profiles with ANT it will be easy for you. Please note to get the full metadata about profiles you need to mention the related data as well. for example to get the profile access related details for an object that object must be present with the profile in same package. Here You ...


1

There is an issue discussed here - https://github.com/forcedotcom/salesforcedx-vscode/issues/680 Retrieving any metadata with a folder structure seems to have this problem. Remove them from package.xml and things should work fine. Use ANT to retrieve the hierarchical metadata and add it to the project folder.


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