function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bretondevbretondev 

Trying to deploy from one sandbox to another with Workbench

Hello

Trying to deploy a validation rukle from one sandbox to another with Workbench.
It is the first time I try, my manager has shown me how to do it the last week, now he is out of the office so I am trying by myself.
I think I am close to the right way but Cannot figure out what is missing.

He showed me that there was two steps : retrieve and deploy.

For the retrieve part I need to provide a package.xml specifying what components I want to retrieve.

So I created the following package.xml file :
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
	<types>
		<members>VerifySiret</members>
		<name>ValidationRule</name>
	</types>
	
	<version>43.0</version>
</Package>

But when I go to Migration > Retrieve and provide my file I get this message, validation rule cannot be found :

User-added image

Can someone please explain what I am doing wrong?
Best Answer chosen by bretondev
bretondevbretondev
I read the Ant migration tool User Guide and they say that for some specific metadata types, including Validation Rules, the name of the object must be specified before the name of the component.

So I changed my package.xml to the following and that solved the issue :
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
	<types>
		<members>Account.VerifySiret</members>
		<name>ValidationRule</name>
	</types>
	
	<version>43.0</version>
</Package>

 

All Answers

mukesh guptamukesh gupta
Hi,

you need to create unmanaged packege and after that you will get a url, use this url in new sendbox and download validation rule.

User-added image 

User-added image

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh
bretondevbretondev
Thanks for the solution, but we want to deploy with Workbench, not with Packages
Raj VakatiRaj Vakati
You need to export them into the zip file along with  package.xml ( Same like how you do in ANT ) and from there you can able to deploy by using metadata .. 


Refer this link 

https://help.salesforce.com/articleView?id=How-to-use-Metadata-API-to-retrieve-and-deploy-contents&language=en_US&type=1

 
bretondevbretondev
Hi Raj

I did exactly what is explained in your link.
I have tried with another validation rule, same issue :

User-added image
bretondevbretondev
I read the Ant migration tool User Guide and they say that for some specific metadata types, including Validation Rules, the name of the object must be specified before the name of the component.

So I changed my package.xml to the following and that solved the issue :
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
	<types>
		<members>Account.VerifySiret</members>
		<name>ValidationRule</name>
	</types>
	
	<version>43.0</version>
</Package>

 
This was selected as the best answer