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
Udaya BhaskarUdaya Bhaskar 

Issue with Territory Assignment Rules

    Hi All,

We are facing a strange issue with Territory assignment rules.

 we have set up territory assignment rules based onthe fields Marketing Domain and sales office which are available on Account object. the rules are working fine when i create a account directly in sfdc  and edit & save the account on salesforce page.

When i create an account through dataloader, the rules are not working. the same is case when i update the account through dataloader.

pls let us know what is missing and what corrective action

Thanks in advance.

Regards,
Udaya
SuperfellSuperfell
You need to set the AssignmentRuleHeader.
Udaya BhaskarUdaya Bhaskar
    Hi Simon,

Thanks for the reply. Please let us know how to set the assignment header. We searched for this feature in the setup  and couldn't find it. In data loader also, we didnt find any option to set the same.

Regards,
Udaya
SuperfellSuperfell
In the DataLoader, goto settings, and fill in the AssigmentRule setting. The value should be the Id of the territory assignment rules you want to run.
Udaya BhaskarUdaya Bhaskar
    Hi Simon,

 We have set the ID and tried to update the record. It is not working. For example, we are trying to update an account record for the fields  Marketing domain, SALES Office. we have specified the right territory id in the settings and tried updating the record. In salesforce, the territory became blank.  the assignment rules are based on the above two fields.
pls give us some pointers on this.
In our case, we have around 30 territory assignment rules. so in this case, should we set this 30 times in teh settings and then do an update.
We are alos updating account records through API Methods, how to ensure or set territory id in this case. we  didnt find any setmethod for the same.

Request your suggestions on this.

Thanks a lot for all the help.

Regards,
Udaya

SuperfellSuperfell
Its not a territory Id, its the Id of the territory rules.
Udaya BhaskarUdaya Bhaskar
Hi Simon,

Thanks Thanks a lot for the help.
Can you please tell us how to set this id from a java program. we searched for setmethod to set this id and didnt find any method.
we have developed daily interface programs that creates/updates accounts in SFDC.

Regards,
Udaya


SuperfellSuperfell
see the AssignmentRuleHeader in the API docs.
Udaya BhaskarUdaya Bhaskar
   Hi,

We are facing an issue in setting the territory id through assignment rule header through java program. PFB the source code.

we are encountering the following error. Default cannot be null.
Please help us on this issue.

Udaya
Code:
String assign_id = "04T20000000CcVl";

ID assign = new ID(assign_id);

_AssignmentRuleHeader arh = new _AssignmentRuleHeader();

arh.setAssignmentRuleId(assign);

bindingIM.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(),"AssignmentRuleHeader",arh)

 

;