This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jan 26, 2012, 10:19 PM
26 Posts

Problem with search datasource script

  • Category: Debugging
  • Platform: Windows
  • Release: 8.5.3
  • Role:
  • Tags:
  • Replies: 1
 
 
I am having a problem with searching a datasource.   I have the following SSJS in the Search In View Result of my view datasource
 
The code also sets an edit box to the search formula that is being computed.
 
I am getting a 500 error  Notes error: Query is not understandable
 
but if I  return  the text of  "FIELD BranchName CONTAINS Pittsburgh"   instead of computing it from one of my fields then the search runs just fine.
 
(in other word return  "FIELD BranchName CONTAINS Pittsburgh"    works.)
 
 
FIELD BranchName CONTAINS Pittsburgh is the very text that is being inserted in ctrlBranchSearchErrMsg  when "Pittsburgh"  is entered into the  searchString field.
 
 
It seems like the value in searchString cannot be obtained when the search is executed.   Could this be the issue?  And if so, how do I fix it?
 
 
P.S.   I have a button that simply does an update of the page after text is entered to be searched.
 
 
 
var ctrl = getComponent( "ByBranchName" );
if (ctrl != null)
{
 
 try
 {
    if (getComponent( "searchString" ).getValue() == null)
    {
        searchText = "";
   
    }
    else
    {
   
        if  (ctrl.getValue() == "1")
        {
            var txt =  "FIELD BranchName CONTAINS " + getComponent("searchString").getValue();   
            getComponent("ctrlBranchSearchErrMsg").setValue(txt);       
           
                       
            return txt;       
        }
        else
        {
           
            searchText = "FIELD BranchKey CONTAINS *" + getComponent("searchString").getValue() + "*";
            return "FIELD BranchName CONTAINS Pittsburgh";
        }
       
       
    }
   
 }
 catch (e)
 {
    getComponent( "ctrlBranchSearchErrMsg" ).setValue(e.message);

 }   
    return searchText;
}
Jan 27, 2012, 6:15 PM
26 Posts
Re: Problem with search datasource script
Got this working.   It had something to do with the edit box where I was getting the text to search.
 
I recreated it and everything is good now.  Very strange.
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal