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
Nicky TorstenssonNicky Torstensson 

Deploying Territory2Rule Metadata Throws Error: Unable to derive the fully qualified name for component at location

Hi,

I created a Territory2Rule in my sandbox org, then retrieved it with SFDX to my local machine, modified some content (not the <name> attribute nor file name), and tried to deploy it back to the sandbox org.

However, it throws an error saying:
Unable to derive the fully qualified name for component at location territory2Models/<rule API name>.territory2Rule.
I am not sure, what exactly that means, since I have not modified the name attribute nor the file name after I retrieved it from the org.

Any input is welcome.

BR, Nicky
Best Answer chosen by Nicky Torstensson
Nicky TorstenssonNicky Torstensson
Hi Shirisha,

I am validating the deploy of Territory2Rules with the command:
sfdx force:source:deploy -c -w 30 -m Territory2Rule
According to the documentation of the source CLI commands (https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_source.htm), you do not need a manifest file for the deployment.

However, I am today able to deploy it without errors, and there is nothing in the Setup Audit Trail, which include relevant changes, nor incidents on status.salesforce.com for the org instance.

Since I am unable to replicate the issue, I will mark the question as answered.

All Answers

ShirishaShirisha (Salesforce Developers) 
Hi Nicky,

Greetings!

Have you included the Territory2Model component as well in the package.xml in manifest.If not,I would suggest you to include both Territory2Rule and Territory2Model  components together to deploy without any issues.

Sample package.xml:
<?xml version="1.0" encoding="UTF-8"?> 
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> 
        <types> 
            <members>FY13</members>
            <name>Territory2Model</name> 
        </types>
        
        <types>
            <members>FY13.AccRule1</members>
            <name>Territory2Rule</name>
        </types>
        
        <version>50.0</version>
</Package>

Please refer the sample metadata of the rules in the below doc.

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_territory2rule.htm

Please mark it as best answer if it helps you to fix the issue.

Thank you!

Regards,
Shirisha Pathuri
Nicky TorstenssonNicky Torstensson
Hi Shirisha,

I am validating the deploy of Territory2Rules with the command:
sfdx force:source:deploy -c -w 30 -m Territory2Rule
According to the documentation of the source CLI commands (https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_source.htm), you do not need a manifest file for the deployment.

However, I am today able to deploy it without errors, and there is nothing in the Setup Audit Trail, which include relevant changes, nor incidents on status.salesforce.com for the org instance.

Since I am unable to replicate the issue, I will mark the question as answered.
This was selected as the best answer