(function(){u8.Crm.TerritoryManagement=function(){this.commandBindings={"TerritoryManagement/CalculateAllocation":this._calculateAllocation.bind(this)}};$.extend(u8.Crm.TerritoryManagement.prototype,{_calculateAllocation:function(){var e=u8.session.webConfigValues.get("UpdateServer.RepID");if(!u8.services.reps.get(e)){u8.services.notification.error("TXT_error_text_80");return}var r=u8.session.webConfigValues.get("Sales.TerritoryManagement.InfoAreas","FI,KP");u8.services.crud.create({infoAreaId:"TD",fields:[{field:"Text",value:"12;"+r},{field:"RepGrpID",value:e},{field:"OfRepID",value:u8.session.identity.repId},{field:"TodoType",value:5}]},i);function i(e,r){if(r.error){return}u8.using({texts:"ui_common"},function(){u8.services.notification.info("TXT_ui_common_9")})}}});u8.services.add("territoryManagement",u8.Crm.TerritoryManagement)})();