cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Territories via DI API

Former Member
0 Kudos

Hi,

I'm trying to add a territory using Territories object of DI API, but I keep getting error -2035, as the territory is always added with TerritoryID = 0, which is restricted. The AutoKey in ONNM table for this object (200) is ok (set to 2).

Is there a solution to this problem? I'm looking forward to your answers.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

The project i'm working on is copying some information from one company to another, and I just found out that the problem exists only if I delete a territory and then add one, and try to copy it to another company. If I add second one it's ok. Our client doesn't need to delete any territories so the problem is solved, thanks

Former Member
0 Kudos

Hi Piotr,

Could you post up a code sample? If you are setting all mandatory fields it should be working and otherwise might be an issue.

As a workaround, have you tried adding one in the application, and then attempting the add through the DI API again?

Regards,

Niall