eService - KBSearch.aspx.cs returns an error

Dec 12, 2008 at 10:13 PM
The KBSearch.aspx.cs control will return an error if it finds an article that doesn't have any keywords associated with it.

The method  SearchByTitleBodyAndKeywords() should be edited from

...

 

foreach (kbarticle article in _crmService.RetrieveMultiple(query).BusinessEntities)

 

{

try

 

{

if (article.keywords.Contains(Cache["msa.eService.CaseWebNotePrefix"].ToString()))

 

{results.Add(article);}}

 

catch (Exception e) {string errorMsg = e.Message;}

To
...
foreach (kbarticle article in _crmService.RetrieveMultiple(query).BusinessEntities)

 

{

try{

 

 

if (!String.IsNullOrEmpty(article.keywords) && article.keywords.Contains(Cache["msa.eService.CaseWebNotePrefix"].ToString()))

 

{results.Add(article);}}

 

catch (Exception e) {string errorMsg = e.Message;}