I have tried to deploy business processes with ant. I seem to have the syntax wrong. I am seeing Entity type: ‘businessProcesses’ is unknown
<?xml version="1.0" encoding="UTF-8"?> <Package xmls="http://soap.sforce.com/2006/04/metadata"> <types> <members>Lead.Process1 </members> <name>businessProcesses</name> </types> <version>32.0</version> </Package>
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
There are two ways:
The entire object
According to the documentation business processes are deployed as part of the custom object metadata file (.object), so you get it if you include the object in the package xml
The package.xml:
<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>Lead</members> <name>CustomObject</name> </types> <version>33.0</version> </Package>
Just the BusinessProcess
In the package.xml specify the BusinessProcess element:
<types> <members>Lead.Test Process</members> <name>BusinessProcess</name> </types>
You can use the Workbench tool to find out the value to put in the XML. In workbench, select Metadata Types & Components. Then select Business Processes. Then select the Object (e.g., Lead). Then find the fullName value.
Snippet of the auto-generated object XML:
<?xml version="1.0" encoding="UTF-8"?> <CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> .... <businessProcesses> <fullName>Test Process</fullName> <description>Lead Process for hardware division</description> <isActive>true</isActive> <values> <fullName>Closed - Converted</fullName> <default>false</default> </values> <values> <fullName>CustomLeadStep1</fullName> <default>false</default> </values> <values> <fullName>CustomLeadStep2</fullName> <default>false</default> </values> <values> <fullName>Open - Not Contacted</fullName> <default>false</default> </values> <values> <fullName>Working - Contacted</fullName> <default>true</default> </values> </businessProcesses> .... </CustomObject>
Method 2
Besides, you can use Visual Studio to obtain that info. First, you can retrieve the BusinessProcesses by using the following package:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>*</members> <name>BusinessProcess</name> </types> <version>53.0</version> </Package>
After looking at the retrieved data, you will see something like that:
=== Retrieved Source FULL NAME TYPE PROJECT PATH ───────────────────────────── ─────────────── ──────────────────────────────────────────────────────────────────────────────────────────── Case.Case Default BusinessProcess force-app/main/default/objects/Case/businessProcesses/Case Default.businessProcess-meta.xml
Now you can see that there is a business process named as “Case Default” (or something else). Now you are sure you can use the following Package:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>Case.Case Default</members> <name>BusinessProcess</name> </types> <version>53.0</version> </Package>
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0