Question
After getting help with an EXISTS check within a submit call on
HowToGrabHTMLValueInCalc, I've run into another problem where EXISTS does not return what I would expect, this time within a formatted search...
I am trying to produce a report using a formatted search with conditional output, that returns all topics with an associated topic of same name, but with 'ContentValidation' on the end of name. The validation topic reference I use twice in the format section is
%WEB%.$topicContentValidation
I use it once in the EXISTS function, which does not seem to work and once on its own, which does work.
The result is that my EXISTS function always evaluates to false, even when the validation topic exists. Is there a difference in how these topic references are expanded or when? I'd really like to understand the problem, as I hope to use a similar search for other reports. Any advice on another way to achieve same is appreciated.
%SEARCH{"." nosearch="on" nototal="on" format="%CALC{$IF($EXISTS(%WEB%.$topicContentValidation),<nop>, $topic (%WEB%.$topicContentValidation) $n)}%" }%
Sample output of search (I would expect only results with question mark on end of topic in brackets to appear in list):
TeamProjectPresentationMenu (TeamProjectPresentationMenuContentValidation?)
TestAnnouncementTitle (TestAnnouncementTitleContentValidation?)
TestTopic (TestTopicContentValidation)
Environment
--
MichelleAlbertin - 31 Jul 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
is this one of these places where you need to escape the %'s ?
TML evaluation is done inside first, left to right - so unless you escape the %'s in the format (using
$percnt ) it will evaluate the %CALC% before it evaluates the %SEARCH%
--
SvenDowideit - 21 Aug 2007
This is correct. Write this:
format="$percntCALC{$IF(...)}$percnt"
--
PeterThoeny - 27 Aug 2007