Query_String Issue When Used with !Open Form

Author: Tripp W Black

Created: 03/07/2001 at 08:28 PM

 

Category:
Notes Developer Tips
Forms/Subforms

WARNING ABOUT USING QUERY_STRING AND THE !OPENFORM COMMAND
by Dan Velasco, Senior Technical Editor (dvelasco@dominopower.com)

If you're using a computed field to capture the Query_String CGI variable (*),
there's something you should know. If you use the traditional Domino method of
opening the form with a question mark (?OpenForm), you don't have anything to
worry about, but if you use the new method introduced in R5 of using an
exclamation point or "bang" (!OpenForm), then your Query_String field is not
computing correctly. The reason is that the computed Query_String field is
looking for a "?" to designate the beginning of the Query_String (get it, query,
question mark) and when it doesn't find one nothing is returned.

So, if you're using Query_String, your best bet is to use the traditional
question mark (?) rather than a bang (!) with the OpenForm command. Here are a
couple of examples:

Use this:
http://server/db.nsf/YourForm?OpenForm&company=Lotus
Not this:
http://server/db.nsf/YourForm!OpenForm&company=Lotus

The reason the bang method was introduced was to help search engines index
Domino sites correctly, since some of these engines skipped over URLs with
question marks thinking they were CGI forms or pages. You'll have to weigh this
against how much you use Query_String on your Domino forms. There's an
alternative to using Query_String, however, and that is to use Path_Info
instead.

(*) To compute the Query_String, create a computed for display field on your
form called Query_String with the formula set to Query_String (no quotes). You
can then extract a variable from the Query_String with the following formula:

@Trim ( @Middle ( Query_String ; "&variablename=" ; "&" ) )


previous page