Hot answers tagged

14

To install a First Generation Managed Package via sfdx, you do it the same way you do it with the metadata API. The command looks like this: sfdx force:mdapi:deploy -d packages The packages folder contains a package.xml file with the following contents: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Package ...


12

Was able to do this using ant's scripting capability. Now you can do ant deploy -Ddir=src -Dtests=Class1,Class2,Class3 <target name="deploy"> <script language="javascript"><![CDATA[ var deployTask = project.createTask('antlib:com.salesforce:deploy'); deployTask.setUsername(project.getProperty("sf.username")); deployTask....


11

Have you tried using: sfdx force:package:install -i 04t6A0000004eytQAA Docs for this are found in the CLI command reference. The only thing is that you'd need to know the ID of the package to pass to the command, but if you can get that, you should be in good shape. EDIT After doing some playing around with this now, when you run the install of an ...


9

Salesforce DX is a new approach to development, not a new interface. As such, it will support all the features that the org supports. This means that you will be able to write Apex, Lightning and VF as you do in your current IDE but your workflow (git, jenkins, circle, etc) might change a lot (or a little) depending on the strategy you choose. I think you ...


8

This helped me get the right id for app exchange packages currently installed in my devhub: $ sfdx force:package:installed:list -u [DevHubAlias] === Installed Package Versions [2] ID PACKAGE ID PACKAGE NAME NAMESPACE PACKAGE VERSION ID VERSION NAME VERSION ────────────────── ────────────────── ───────────────────── ...


8

We recently ported the famous Java Static code analyzer PMD to Apex. We also ported many of the original Java rules and created a few Apex specific to showcase how to write language-specific rules (e.g. AvoidSoqlInLoops, AvoidLogicInTriggers,...). Other than CodeScan, our effort is open source and was merged back into the original PMD repository on Github (...


8

The Namespace Registry Connected App is the Connected App under which your Dev Hub authorizes to your packaging org. Completing this linkage allows your Dev Hub to spin up namespaced scratch orgs using the namespace owned by the packaging org. If you don't use namespaced scratch orgs, you don't need to connect the namespace registry. You shouldn't try to ...


7

I have written a series of blogs on setting up continuous integration with CircleCI and SFDX: CircleCI and Salesforce DX Testing on Multiple Org Types with CircleCI and Salesforce DX Integration Testing Off-Platform Code with Salesforce DX and CircleCI I also have a GitHub repository with a number of examples using SFDX and CircleCI alone, with multiple ...


7

For your Scratch Orgs, you can use the DefaultWorkflowUser feature in your project-scratch-def.json file to set the value with the scratch org user: ... "features": ["DefaultWorkflowUser"], ... The feature value is documented here, even though it's not explicitly explained what it's doing.


6

What is the best way to get all the metadata of an existing org into Git (Bitbucket) for the first time into a master branch? You need to generate a package.xml to pull all the existing metadata that you're planning to manage in Git and execute a Metadata API retrieve operation. You can construct the package by hand, or use a tool to prepare one. One ...


6

I'm going to have to answer the questions out of order for them to make sense, and much of this is anecdotal at this point, but we've been doing this for a couple of years now, so I hope that this answer will be useful. Is the recommended approach documented anywhere? There are several competing theories on which way is the "best," and it's not related ...


5

We are using a very similar setup internally. What we have found works is that 1) All devs work in their own separate sandboxes. 2) All development is done in feature branches. 3) When work is ready for QA/Integration testing feature branches are merged into master. 4) Jenkins build runs whenever there is a commit to master and performs a deploy to the ...


5

There are numerous strategies for doing so (So, there is no 1 good answer), however, here are a few resources that can help answers some if not all those questions based on your needs: GitFlow Examples These examples are using the default configuration with GitVersion. Which is continuous deployment mode for develop and continuous delivery mode for all ...


4

As long as a component is available as a Metadata component, you can utilize that in any Continuous Integration solution. It’s not restricted to only apex or lightning component. You can deploy workflow rules, profiles, permission sets, named credentials, etc. to name a few. On top of this, you should definitely explore Salesforce DX if you are starting ...


4

While I will recommend to move to Salesforce DX, but in the traditional model of release management, your master should always be a replica of what's in Production. A typical flow that I have followed in the past is: Create master as the gold copy. This should be your most recent stable copy of running code in Production. You will need to decide which ...


4

Unfortunately, as of the time of this answer, there is no public API that allows you to set this value. You would necessarily need to change it manually each time.


4

Thanks to the hint from Mohith Shrivastava I managed to get rid of this error message by using scratch org definition file with Communites and Sites and Networks enabled: { "orgName": "Demo Company", "edition": "Developer", "features": ["Communities", "Sites"], "settings": { "orgPreferenceSettings" : { "s1DesktopEnabled": ...


4

After you login, can you run something like sfdx force:org:display --verbose -u DevHub --json | jq -r .result.sfdxAuthUrl to get the auth URL, store the value securely somewhere, then run sfdx force:auth:sfdxurl:store -f <secure location> -a DevHub -d in each step? This is how I solve a similar challenge across build/release phases for the Salesforce ...


3

Are you by any chance using MacOS? It could be due to an issue that the DX tooling cannot connect to the keychain as it's attempting to display a dialog window to indicate this and results in it appearing to hang. Below is a simplified version of a declarative pipeline which shows how to use the generic keychain functionality and resolved the issue for me. ...


3

This should be your Example dev cycle Pull dev branch from git to get most recent changes Checkout local feature branch Push to developer sandbox Make changes to sandbox (config or code) Pull from developer sandbox Commit changes Repeat last 3 steps until feature is complete Checkout dev branch Pull dev branch If there are changes: Checkout local branch ...


3

Based on the discussion in the comments... The problem appears to be with how the package contents was being passed to Salesforce. That is, it deployed when directly passed to the Metadata API via workbench as a flat structure, but was failing when the folder structure was included in the zip file. As per the answer to Metadata Deploy - Package.xml Failure,...


3

Here's an example using ant. The directory structure: ├── build.xml ├── lib │   └── ant-salesforce.jar ├── src │   ├── classes │   │   ├── HelloWorld.cls │   │   └── HelloWorld.cls-meta.xml │   ├── destructiveChangesPost.xml │   ├── objects │   │   └── Hello__c.object │   └── package.xml └── .travis.yml Create a build.xml for the Force.com Migration Tool (...


3

Unfortunately, the metadata API will not let you deploy a flow or process to overwrite an active one. If you are in sandboxes and can use changesets, that's the best way to resolve this. What CI tool are you using? You might be able to write a pre-deploy hook to deactivate any active flows/processes first.


3

The description and detailed setup provided in the below link is very useful and it worked in my case. May be it helps you : Continuous Integration


3

Disclaimer: I work for Gearset I'm a little late to the party but hopefully I can add something of value - we've got a few largely product-agnostic whitepapers for download that might be useful to you, specifically: Simplifying Salesforce release management: talks about developing a process from a sandbox to sandbox model to something more complex targeted ...


3

In the end the problem was in the server time being way off. So if you have this problem, check your CI/CD server time. If it's off, please sync the time using NTP sync: sudo service ntp restart


3

Script Level There's essentially a couple of steps involved to this process of doing a delta deployment. The first is to identify the changed components. If you're working with Git and GitLab Pipelines, this is not difficult. Given a start and an end commit, it's just git diff start-commit end-commit --name-only --diff-filter=ACM to get a newline-...


3

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 """...


3

We need to be clear about terms here. A Developer sandbox is associated with a production org and cannot be a Dev Hub, although your production org itself can be a Dev Hub (and comes with significantly higher limits, for most editions, than a Developer Edition org). A Developer Edition org is an independent production org (signed up from developer.salesforce....


3

Jenkins is the CI software that runs on some form of compute platform (PC, server, whatever - something with an OS, storage and a CPU with memory); AWS is being used to provide a virtual server on which Jenkins is installed and run. Note that, certainly in our Salesforce CI implementation, all you actually need the "CI server" to do is execute a ...


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