Web Services in Saleslogix
Nicolas Galler | June 11, 2008Just a quick tip in case you need to define a web service that accesses the Saleslogix entities – it works great, as long as you remember to enable the attribute to let it access the session variables (session state is disabled by default on web services).
For example this is the web service I use for a cascading dropdown (using the Ajax control toolkit stuff). The EnableSession=true was the key part in getting this to work:
[System.Web.Services.WebMethod(EnableSession=true)] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public CascadingDropDownNameValue[] GetSubSpecialties(string knownCategoryValues, string category) { StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues); if (!kv.ContainsKey("specialty")) return null; var pklItems = PickList.GetPickListItemsByName("SubSpecialty " + kv["specialty"], true); var values = new List<CascadingDropDownNameValue>(); foreach (var p in pklItems) { values.Add(new CascadingDropDownNameValue(p.Text, p.Code)); } return values.ToArray(); }





