sfdx-isv / territory-management-toolkit

The Territory Management Toolkit (TM-Tools) is a Salesforce CLI Plugin that provides tools for simplifying the migration of a Salesforce org from Territory Management (TM1) to Enterprise Territory Management (TM2).
BSD 3-Clause "New" or "Revised" License
9 stars 0 forks source link

Warning "Some post-deployment tasks did not complete successfully " #9

Open purvajainnn opened 4 years ago

purvajainnn commented 4 years ago

Hi @VivekMChawla ,

I was on Deploy step and I get the below warning

✔ Query TM2 Org for Territory2 Record IDs ✖ Update Territory DevName Mappings ✖ Finalize Transformation of User/Territory2 Association Files ✖ Finalize Transformation of Object/Territory2 Association Files

Warning - Some post-deployment tasks did not complete successfully (see above)

image

Can I continue to Load after this ? I have used this tool on 10 other sandboxes but didn't get this earlier, could you please let me know what is different in this case?

Regards Purva

VivekMChawla commented 4 years ago

Hi @purvajainnn ,

Can you paste the contents of the tm2-deployment.json file that was created after running this command? (Please use a ``` markdown block so it renders as code in your comment)

purvajainnn commented 4 years ago

Its a long json to be added as a comment :( Can I send you in an email ?

VivekMChawla commented 4 years ago

@purvajainnn - Sure. Please email it to vchawla@salesforce.com

purvajainnn commented 4 years ago

thanks done

VivekMChawla commented 4 years ago

@purvajainnn - Inside the tm2-deployment.json file you can see the list of deployment failures.

Here's the first one. All of them are the same and are the reason why the deployment process failed.

"componentFailures": [
{
  "changed": "false",
  "componentType": "Territory2",
  "created": "false",
  "createdDate": "2019-10-03T05:25:30.000Z",
  "deleted": "false",
  "fileName": "tm2-main-deployment/territory2Models/Imported_Territory/territories/REA29.territory2",
  "fullName": "Imported_Territory.REA29",
  "problem": "Exceeded the maximum number of territories per territory model.",
  "problemType": "Error",
  "success": "false"
},
...component failures continue...
]

Basically, it looks like you're you're trying to insert too many territories into a single territory model.

It may be that this particular org has more TM1 Territories than can be supported in a single model in TM2.

Is this the largest set of Territories that you work with? Will others possibly be this size?

I wasn't aware of a limit like this, so we may need to add a feature request for tmtools:tm1:analyze to detect when the org has too many territories and give the user a warning.

purvajainnn commented 4 years ago

yes and possibly more than this.

VivekMChawla commented 4 years ago

@purvajainnn - How many territories, total? You can find this in the tm1-analysis.json file.

purvajainnn commented 4 years ago

}, "tm1RecordCounts": { "territoryRecordCount": 3062, "userTerritoryRecordCount": 9299, "ataRuleRecordCount": 17, "ataRuleItemRecordCount": 17, "accountShareRecordCount": 3073, "groupRecordCount": 6124 },

purvajainnn commented 4 years ago

So what will the tool do, chop the excess territories and load them partially if i try to proceed on this org ?

VivekMChawla commented 4 years ago

@purvajainnn - I found this Salesforce Knowledge Base article that should help.

Increase the maximum number of Territories per Territory Model in Enterprise Territory Management

I think the right thing to do is to get the customer orgs updated with expanded limits during the same support interaction that enables TM2.

Once the limits in the org are updated, you should be able to use the TM-Tools plugin as normal.

Would it be possible to test drive this scenario on a sandbox with the largest number of Territories to migrate? It would be great to see this working end-to-end in that kind of high-volume environment.

purvajainnn commented 4 years ago

Sure @VivekMChawla let me see if thats possible.

Following up on on my earlier question, Can I still proceed to Load after this step ? Will the tool still load the territories partially ?

dkallman commented 4 years ago

Hi Vivek, it's pretty common for our customers to have more than 1,000 territories. To avoid this issue, is it possible to proactively increase the limit based on the number they have in TM1? I do not think we currently have any customers beyond 20k territories, which is the number that requires additional approval to go beyond.

purvajainnn commented 4 years ago

In addition to that we still will need to have the Migration tool to handle more than 1,000 territories, is that correct ?

Right now the user gets to know this on Deploy after we have already extracted the data from TM1 model, transformed it and not on analyze.

purvajainnn commented 4 years ago

@VivekMChawla I tried to Load after I got the warnings on Deploy but couldn't even load the territories since the Deploy actually failed with that warning.

Checking for Available Territory2 Model... ✖ Validate that the migrated Territory2 model is available (Active/Planning)

Final Status
TM2 Model Availability : The migrated Territory2 model is not available in the target org Command Failed : tmtools:tm2:load exited without completing the expected tasks