
DocumentOpen with variable filter
DocumentOpen with variable filter
How can i get a variable value (The value of a field in the current record) into the DocumentOpen statement?
If I put a hardcoded value in it works fine but I cannot seem to insert a variable value into the statement.
DocumentOpen("ProcessHistoryView/?BuildNumber=1234") works fine but
DocumentOpen("ProcessHistoryView/?BuildNumber=FieldName") does not, even if FieldName is replaced by a GetVar statement (ProcessHistoryView is a Quick Report).
Re:DocumentOpen with variable filter
Sorry for the late reply.
DocumentOpen(concat("ProcessHistoryView/?BuildNumber=",FieldName"))
DocumentOpen need a text string, so if you want it to be variable you need to build a text string that is variable the normal way.
I think you have gone a little "blind" here and can't see the forest for all the trees ;-)
DocumentOpen("ProcessHistoryView/?BuildNumber=FieldName") will not work "twice" over.
1. The filter will be BuildNumber=Fieldname were Fieldname is a fixed string.
2. Because the filter is BuildNumber=Fieldname it is illegal too as strings need to be quoted i.e BuildNumber="FieldName".
if you would want to build a filter (that is what this is) where you wanted to transfer a string/text you would have to do it this way.
DocumentOpen(concat("ProcessHistoryView/?BuildNumber=/'",FieldName"/'))
this way you get it escaped so your result will contain " " around the value.