select count(*) enabled from tbl_LIB_ModSettings where companyPKeyId = and companyPType = and moduleId = 86 and settingid = 11 and value = 1 SELECT territoryid, name, territoryName, brokerLevel, Rank, parentTerritoryID, primaryManager FROM request.qmd_userTerritories WHERE brokerLevel = 1 SELECT distinct parentTerritoryId FROM request.qmd_listBrokerMrkts WHERE brokerLevel = 1 SELECT territoryid, name, territoryName, brokerLevel, Rank, parentTerritoryID, primaryManager FROM request.qmd_userTerritories WHERE brokerlevel <> 1 filterChanged = false; applyDistributorContext(); _paramName = ListFirst( _param, "=" ); _paramValue = ListLast( _param, "=" ); StructInsert( client, _paramName, _paramValue, true );