In some SSJS I do a FTSearch to retrieve values that I then manipulate and feed to a repeat control. The query is pretty complex and I have it all working except this piece.
var qString = tmpArray[cTerms++] = "((FIELD [WFSCompletedDate] > " + dString + ") AND (FIELD WFSOrig CONTAINS \"" + user + "\"))";
and when the code runs it resolves to the below:
((FIELD [WFSCompletedDate] > 11/13/2013) AND (FIELD WFSOrig CONTAINS "Bill Fox/Workflo Systems"))
next I do:
var dc:NotesDocumentCollection = database.FTSearch(qString);
viewScope.put("vsCollCount",dc.getCount());
However, it never gets to the viewScope.put
In my overall query if I use all of it but comment out the line above the search works fine. The issue is that the code stops running at the FTSearch so dc.getCount is never executed. I have tried it with the [] and without them but the results are always the same. Where the field WFSCompletedDate is present in a document it contains a legitimate date, the field is never blank. Very confusing because in the larger query one part is: query] = "(!((FIELD WFSStatus = Draft) OR (FIELD WFSStatus = In Process) OR (FIELD WFSStatus = Approved) OR (FIELD WFSStatus = Denied))AND (FIELD WFSOrig CONTAINS \"" + user + "\") AND [_RevisionDate] > " + dString + " )"
and uses [_RevisionDate] and this does not cause a problem.
Thanks for the help
tmpArray[cTerms++] =
in your code line? – Knut HerrmannFIELD [WFSCompletedDate] > 11/13/2013
looks for an item with brackets in its name.FIELD WFSCompletedDate > 11/13/2013
or[WFSCompletedDate] > 11/13/2013
look for an item without brackets in its name. But Knut is on to something too: that double assignment syntax looks wrong... in the context of your larger code that we're not seeing, it might be "right", but if you want to make troubleshooting easier, steer clear of any code patterns that look wrong even when they're right. – Tim Tripcony