27
votes
Accepted
Migrating Named Credential with password
adding password manually after retrieve and before deploy worked :
<?xml version="1.0" encoding="UTF-8"?>
<NamedCredential xmlns="http://soap.sforce.com/2006/04/metadata">
<...
22
votes
Accepted
How do I retrieve Lightning Web Components using Ant Migration tool or mdapi:retrieve command from SFDX?
The new Metadata API component is called LightningComponentBundle
The following XML code should be added to package.xml:
<types>
<members>*</members>
<name>...
16
votes
Migrating Connected App - Ant Deployment Error
According to the ConnectedApp Metadata API documentation, each connected app must have a unique consumerKey value.
One way to deploy your connected app is to remove the consumerKey from the ....
12
votes
Accepted
Run Specific Tests with Ant Deploy specified by command line or file
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[
...
10
votes
Accepted
How to retrieve or deploy Custom Metadata Records by ANT Migration Tool?
Gosh!
This works:
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_custommetadata.htm#meta_custommetadata
<types>
<members>*</members>
<name&...
9
votes
Deployment issues with Process Builder Flows
I wrote an ant target to help with the deployment of flows.
Before deploying flows, I fetch the flow definitions, then only deploy flows that are newer than the currently active version.
This ...
9
votes
unable to obtain exclusive access to this record
This is because of record locking. From the Salesforce Developer site:
This is something temporary and would be fixed automatically in 10-15 minutes maximum.
Some common causes are:
...
8
votes
What is a good and free static apex code review plugin for IDEA, eclipse and ANT?
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....
8
votes
Accepted
How to deploy Approval processes using ANT migration tool?
When you add fullName to a package.xml, the metadata API assumes you're trying to insert/update a package instead of deploying unpackaged metadata. You must not specify fullName when deploying ...
8
votes
ANT deployment of custom field fails - Error: Property 'picklist' not valid in version 39.0
I think from 37 Api ver picklists are replaced with Valuesets in metadata definitions and it causes an error when You try to deploy 'old' metadata with higher Api Version. To get rid of this error, ...
8
votes
Accepted
Retrieve a change set from scratch org using sfdx?
I managed to create a change set in my scratch org and put the metadata I wanted to retrieve from the scratch org.
I managed to pull that change set the same way one pulls a package:
sfdx force:...
7
votes
Entity type 'ApexClass' is not available in this organization
This could be a profile issue. Make sure your user's Profile has the "Author Apex" permission.
7
votes
Accepted
ANT Force.com Migration Tool and Encrypted Password
You could do some sort of encryption that you can decrypt as an ant target task - like a base64 decode or something.
The problem with that is anyone who's savvy enough to be able to look in the ...
7
votes
Accepted
are there alternatives to Salesforce ANT
Generically speaking, yes, you can use almost any modern CI along with any modern build system and any modern code versioning system. I don't have specific instructions available for you, but assuming ...
7
votes
How To Retrieve LeadConvertSettings with Force.com Migration Toolkit
In package.xml file with 39 version of API. It works
<types>
<members>*</members>
<name>LeadConvertSettings</name>
</types>
7
votes
Accepted
What version of ant-salesforce.jar am I using?
I have found some custom way, how you can detect your API version of ant-salesforce.jar. jar is an archive file, so it is possible to restore this file into components. Use WinRar or another archiver-...
7
votes
Accepted
Get Lightning Web Component (LWC) definition on a describe
LWC was introduced in latest release - Spring '19 and it's API number is 45.0 so if you describe your metadata using 44.0 MDAPI won't be able to see those components. You need to change "-a" parameter ...
7
votes
Accepted
Deploying destructive changes using SFDX with --sourcepath flag
We had the exact same issue, where we are using sourcepath for our deployments and we didn't want to use a package.xml for deployments. But using the create manifest command I managed to work around ...
6
votes
Ant profile deployment - You cannot deploy to a required field Object_Name__c.Field_Name__c
"Since API version 30.0 a change set or ant deployment will fail if a field that is required in the field definition is included in a profile or permission set that is being deployed.
If you ...
6
votes
Accepted
Use ANT to execute existing ApexTests
You can use the new compileAndTest task to run tests without a package.xml.
Your build.xml can look like this:
<project name="salesforce" xmlns:sf="antlib:com.salesforce">
<property ...
6
votes
Accepted
Using DX Scratch Orgs to deploy code with legacy ant scripts
Is it possible just to use hub and DX cli to quickly spin up new scratch org with required configuration, create new user with password and then use it to deploy code in an old-fashioned way using ...
6
votes
Accepted
How to mass-deactivate 700 picklist values
Set the isactive attribute to false and deploy those values back using ant.The values will be made inactive
Check documentation here
Example to set 2 values as inactive:
<?xml version="1.0" ...
6
votes
Accepted
Effective and efficient deployment
You are using old tools and processes, which are indeed quite inefficient and ineffective.
The Ant-based Force.com Migration Tool can be replaced by Salesforce DX.
Salesforce metadata should be stored ...
5
votes
Accepted
DestructiveChanges.xml fails because component doesn't exist
Set the ignoreWarnings attribute to true to prevent sf.deploy from failing when components in destructiveChanges.xml are not found, e.g.
<sf:deploy username="${sf.undeploy1}" ... ignoreWarnings="...
5
votes
Accepted
Error: Unknown user permission: ManageCssUsers
That permission corresponds to the "Edit Self-Service Users" checkbox on the profile. In my case, enabling communities for my org added that permission option.
References:
https://help.salesforce....
5
votes
Accepted
How to run all the test classes in the org using Ant?
yes that is correct. sf:compileAndTest is no longer supported but you can run all test from sf:deploy task with the runAllTests="true" attribute, you don't need to actually deploy anything, though you ...
5
votes
Error: field integrity exception: unknown (required must not be specified)
Bit of an old question, but since there's no answer yet, I'll post my experience.
I got the same message when I tried to deploy a field from sandbox A to sandbox B. The field was named Nationality__c,...
5
votes
Accepted
How to match profile name to ant metadata profile name and vice versa?
I think I have finally found the solution.
While one of the possible point-and-click way is suggested by @user3375426 to create an outbound changeset and click add Profiles there (I have added here ...
5
votes
Accepted
INVALID_TYPE: Cannot use: ApexClass in this organization
It seems there was an Author Apex permission I needed, which had somehow gotten unset at some point.
Adding this permission to my profile has resolved the issue.
5
votes
Deployment Error: Invalid field:** in related list:RelatedAccountContactRelationList
I know this is a old post, but encountered the error today while deploying. Since no one answered, I thought of replying to the post.
The reason for this error is because the environment you ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
ant × 414deployment × 182
migration-tool × 101
metadata × 42
metadata-api × 38
apex × 36
package.xml × 25
profile × 22
continuous-integration × 21
jenkins × 21
migration × 20
salesforcedx × 17
unit-test × 14
change-set × 13
force.com × 12
sandbox × 12
managed-package × 11
package × 11
ci × 10
ant-script × 10
permissions × 9
destructivechanges.xml × 9
picklist × 8
error × 7
eclipse × 7