searchFormula = {Form = “Content1” & Status = “Live” & ContentID = doc1.ContentId(0))}
I hate these things
searchFormula = {Form = “Content1” & Status = “Live” & ContentID = doc1.ContentId(0))}
I hate these things
Subject: Wahts wrong with this
This works with a notes View
SELECT Form = “Content1” & Status = “Live” & ContentID = “E90DDAA”
but when I run this in script
Dim strContentId As String
strContentId = approvedDoc.ContentID(0)
searchFormula = {Form = “Content1” & Status = “Live” & ContentID =”} & strContentId & {“}
Set collection = db.Search(searchFormula,dateTime,0)
it returns nothing into the collection. The value E90DDAA is the contents of the variable strContentId as seen by the debugger.
HELP
Subject: RE: Wahts wrong with this
Does this make a difference?
Dim strContentId As String
strContentId = approvedDoc.ContentID(0)
searchFormula = {Form = “Content1” & Status = “Live” & ContentID =”} & strContentId & {“}
Set collection = db.Search(searchFormula,nothing,0)
Subject: Wahts wrong with this
Your formula’s not going to recognise doc1.ContentID(0) as a valid string.
You need to build the formula properly, with the string delimiters adding the actual value of doc1.ContentID(0) as the Lotusscript sees it:
searchFormula = {Form = “Content1” & Status = “Live” & ContentID = “} + doc1.ContentId(0) + {”}
So the doc1.ContentID(0) is outside the string delimiters, applying the real value (hope that makes sense)
Dan
Edit - oh yeah, and what Mike says about the quotations marks too:) code updated
Subject: Wahts wrong with this
well … please give us a liitle bit more information about the rest of your code
would be better to give a bigger context , so we can help you much faster
Subject: Wahts wrong with this
Should be…
searchFormula = {Form = “Content1” & Status = “Live” & ContentID = “} & doc1.ContentId(0)) & {”}
Subject: RE: Wahts wrong with this
This works with a notes View
SELECT Form = “Content1” & Status = “Live” & ContentID = “E90DDAA”
but when I run this in script
Dim strContentId As String
strContentId = approvedDoc.ContentID(0)
searchFormula = {Form = “Content1” & Status = “Live” & ContentID =”} & strContentId & {“}
Set collection = db.Search(searchFormula,dateTime,0)
it returns nothing into the collection. The value E90DDAA is the contents of the variable strContentId as seen by the debugger.
HELP
Subject: RE: Wahts wrong with this
What’s dateTime? If you just want to return everything use Nothing instead
Subject: RE: Wahts wrong with this
Changed it to nothing and the collection is still not being populated.Out of the Script debugger
Searchformula evaluates to
"Form = ““Content1"” & Status = ““Live”” & ContentID =”E90DDAA“”
Is that correct ?
Subject: RE: Wahts wrong with this
Hi Gary,
I noticed that the quotes around E90DDAA are different from the normal quotes used. I think it will work if you change them to regular quotes.
Regards,
René
Subject: RE: Wahts wrong with this
Plese try this:
searchFormula = {SELECT Form = “Content1” & Status = “Live” & ContentID =“} & strContentId & {”}
Set collection = db.Search(searchFormula,Nothing,0)
If you do not get the collection from search then copy value of searchFormula from debugger and use it in your view if you still do not get the collection in view then try to remove ContentID from formula and so on.
I hope it will help you.
-Mohammad Ashfaq