6

I have a Territory Account assignment rule with a simple condition. If the Account Country = United States and State = XYZ, assign to a territory. The assignment rule works fine and there are accounts assigned to this territory. However, recently when I reran the rules, it removed few accounts from the territory which had a matching condition. Morever, if I manually edit the Account and save it, the account is assigned to the Territory. Running the rules again removes the account from territory.

I checked salesforce help but couldn't find any reason why an account with matching condition would be removed from a territory. Can someone help me out here?

Example of rule:

(Account: Account Record TypeEQUALSCommercial) AND (Account: Billing CountryEQUALSUnited States) AND (Account: Billing State/Province CodeEQUALSWA,OR,NV,ID,MT,AK,HI,UT,CO,KS,NE,WY,ND,SD,MN,IA,WI,MI,IN,IL)

Example of Address of Commercial record:

Chicago, Illinois 60606 United States

Here Illinois is IL and hence satisfies the territory rule. There are other accounts as well in Illinois who have the territory assigned perfectly but for very few the run rules remove them from the territory. Same is the case for few other states as well.

Update: I created another question which may hold the answer to this. Link: Query Account field IsExcludedFromRealign

  • It would help if you posted and example of one of your rules that is failing so people have a better idea of what you're dealing with. – crmprogdev Aug 10 '14 at 14:50
  • @crmprogdev Added example in the question. – RajeshShah Aug 10 '14 at 18:11
1

IsExcludedFromRealign would also prevent the reassignment when manually updated no?

When you go into a territory and select Manage Rules, down at the bottom there is a Preview button. Does the account show there? Could it be that there is another assignment rule running when you manually update and thus not working when you run the rule you're looking at? Are you actually pressing the Run Rules button?

Not trying to be condescending but running through all the possible scenarios.

0

I don't know if you've done this in all your other rules or not, but I see spacing issues with what you've posted that would cause problems running them.

(Account: Account Record TypeEQUALSCommercial) AND (Account: Billing CountryEQUALSUnited States) AND (Account: Billing State/Province CodeEQUALSWA,OR,NV,ID,MT,AK,HI,UT,CO,KS,NE,WY,ND,SD,MN,IA,WI,MI,IN,IL)

has a problem with no space between TypeEQUALS and Commercial, CountryEQUALS United, and CodeEQUALS WA, so should look like:

(Account: Account Record TypeEQUALS Commercial) AND (Account: Billing CountryEQUALS United States) AND (Account: Billing State/Province CodeEQUALS WA,OR,NV,ID,MT,AK,HI,UT,CO,KS,NE,WY,ND,SD,MN,IA,WI,MI,IN,IL)

Note that I checked the source code you'd pasted into your original message above before posting this answer. I strongly suspect your errors are caused by the missing spaces since the rules as typed would make no sense to SF.

  • Space is not issue. Its just that the formatting got messed up when I pasted the rules from Salesforce to here. – RajeshShah Aug 11 '14 at 6:36
0
+50

I assume since you're referencing the state/province code field, that you're using State and Country Picklists.

Once you enable S&CP, the code fields should be the source of truth. If the problem isn't the spacing issue that crmprogdev pointed out, try using Billing Country Code instead of Billing Country. It's possible that you might have accounts with text and code field out of sync.

(You can check for this by running a report on Accounts where

  • Billing Country = "US"
  • Billing Country (text only) != "United States" (or whatever your integration value for US is)

If you find accounts like that, out of sync, re-saving them will fix it.)

  • The Billing Country has the value US. Also as I mentioned, if I save the account manually, the Territory is assigned successfully. However, running the rules again removes the Account from the territory. – RajeshShah Aug 11 '14 at 6:48
0

Was finally able to fix this though still not sure what was the issue. I noticed that the preview was not showing the accounts I wanted even though the columns themselves showed that they were satisfying the conditions. Because of this I created another rule to the same territory. In this rule, instead of specifying the 2 digit state code, I specified the complete State string. And it was working. So in the end, I combined the two rules.

(Account: Account Record Type EQUALS Commercial) AND (Account: Billing Country EQUALS United States) AND ((Account: Billing State/Province Code EQUALS WA,OR,NV,ID,MT,AK,HI,UT,CO,KS,NE,WY,ND,SD,MN,IA,WI,MI,IN,IL) OR (Account: Billing State/Province EQUALS Washington,Oregon,Nevada,Idaho,Montana,Alaska,Hawaii,Utah,Colorado,Kansas,Nebraska,Wyoming,North Dakota,South Dakota,Minnesota,Iowa,Wisconsin,Michigan,Indiana,Illinois))

Now when I run the rules, the assignments are proper. I still don't understand 1 issue though. Why did manually saving the account assigned the territory while running rules removed it?

But atleast it is working for now. Thanks for all your help.

0

You don't need to use both State/Province Code and State/Province, the best solution is to use 'contains' instead of 'equal' to with State/Province Code:

(Account: Account Record Type EQUALS Commercial) AND (Account: Billing Country
EQUALS United States) AND ((Account: Billing State/Province Code CONTAINS
WA,OR,NV,ID,MT,AK,HI,UT,CO,KS,NE,WY,ND,SD,MN,IA,WI,MI,IN,IL))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.