Using URL Parameters

There are many contexts in which passing data from one page to another via the URL is a convenient means of transferring data.

Parameters such as primary and foreign key values can be passed from one page to another through the destination page’s URL.  For example, you can create a "wizard" from a New Orders page to a New Order Details page by passing the OrderID of the new Orders record on the URL so that the OrderDetails.OrderID field is automatically set in the New Order Details page.

URL query string format

A simple URL with a query string parameter is:

http://OrderManagementSystem/ShowOrder.aspx?ID=10248

In this example, the text string “ID” is specified as the query string parameter in the Property Sheet.  The query string parameter “ID” is then used in the page’s URL.  The application recognizes “ID” as a valid query string parameter and uses the value assigned to ID in the URL as part of the SQL query.

The receiving page might use the query string parameter as part of a WHERE clause that filters, or limits, the data displayed in a table, e.g.:

Order.OrderID is equal to ID

Permissible query string parameters

The query string parameter can be any alphanumeric string you wish.  It does not have to match the database table’s field name or correspond to anything else.  Your application will parse the query string, extract the appropriate parameter and value, and perform the record lookup in the appropriate database table.

In use, the query string parameter follows the URL, as does “ID” in this example:

Passing data using URL parameters when a button is clicked

URL parameters can be used for passing data from one page to another when a button is clicked.  These URLs are specified via the Button Action Wizard in the Property Sheet.  For example, when a user clicks the “Show” button on an Table Report page, the the primary key value (ID) of the selected table row entry can be passed to a Show Record page to display the full details of the selected record.

Pass data between pages using URL parameters, as shown in the Redirect Action Wizard.

To select which URL parameters to pass:

Step 1:  In the Layout Editor, select the button control you wish to configure. 

Step 2:  In the Property Sheet, Button actions, select Redirect and open the Redirect Action Wizard.

Step 3:  Configure the URL and associated parameters.

Options

Description

URL

The URL of the page to be displayed when the button is clicked.

The URL field has this format:

            http://<Page URL>?<Parm1>=<Value1>&<Parm2>=<Value2>

Here’s an example:

            http://AcmeOMS/View-Orders.aspx?OrderID={PK}&Name={FK}

The format of the URL parameters (such as PK in the example above) is:

            [ControlName:][NoUrlEncode:]Type[:Value]

When the URL is consumed by a Record control, the associated record is used at run-time to construct the actual URL containing the specified URL Parameters.  When consumed by a Table control, the Table control’s selected record is used.

The URL may include hard-coded arguments as well as parameterized arguments.

There are a variety of substitution variables described inSubstitution variables.

The special arguments that may be entered into this field are:

{0}
{1}
etc.

Any number of positional arguments can be included in the URL.  Numbers enclosed in curly braces indicates that the value should be calculated from the URL Parameters (see below).

Back

This argument can be used with the special "updatedata" URL Parameter, which is related to page history (Back key) handling.

You can modify a page’s OK or Cancel button to return "Back" to a previous page with fresh data by adding an "updatedata" URL Parameter.  This causes the previous page to load with fresh data, while maintaining settings (such as page size displayed, sorting, etc).

Close

Clicking the button will cause it to emit client script during the post back that will close the browser window when the post back's Http Response is sent back to the browser.

Since Iron Speed Designer does not (currently) easily support applications that use multiple browsers in the same session, this feature is currently most useful in conjunction with customization.  However, there may be rare situations where a developer might want to use it without customization, such as an application’s sign out button to use the Close URL instead of redirecting to a sign out confirmation page.

URL Parameters

The URL parameters, if any, to pass to the page being displayed via the URL.  There is a variety of substitution variables described inSubstitution variables.  In order to make pages more user-friendly, Iron Speed Designer includes new URL parameter “TabVisible=False”  when you select “Navigate a specific URL within a modal pop-up”  to hide tabs when page is opened in a modal pop-up. Also if you specify a control to update on the Action step, “SaveAndNewVisible=False” will be included and the Save and New button will not show up on the page opened in modal pop up. If you think the tabs or Save and New button are helpful, you are welcome to remove these URL parameters but note that there are some major limitations:

if you close the window or cancel from it after one or more clicks to Save and New without ever clicking Save, underlying control will not be updated, new records will not be reflected. User will need to manually (F5) refresh a page to see new records Control is updated only when Save button is clicked.

Another important limitation is that only last added record will be added to the dropdown list if it was selected to be updated so if several were added via Save and New button only last will show up in the list after Save was clicked.

Tabs might not fit pop-up window and could require vertical and horizontal scroll.

 

Substitution variables

In the generated code function calls will use substitution variables. The following substitution variable types are available:

Type

Value

Description

FDV

Reparsable display format

Database field name
or
Field display name

FDV returns (converts) the database field value as a string using the field’s display format, as specified by the database field properties, but the string may not be reparsable.  The display string may be different than the database field name because you may have selected a different display format.

For example, FDV converts field values to an expanded “display foreign key as” (DFKA) string for DFKA-enabled fields.  For most field types, this is the same as FVS if there is no DFKA configured.  However, FDV will convert Password values to "*****" and Credit Card Number values to the "masked" format (e.g. "XXXX-XXXX-XXXX-0000").

Example:

            FDV:BirthDate

Returns:

            08+December+48+A.D.+00-00-00-AM

(08 December 48 A.D. 00-00-00-AM, assuming the display format is dd MMMM yy gg HH-mm-ss-tt)

FDV may be prefixed by NoUrlEncode to indicate that the value will not be URL encoded.  (E.g., spaces will not be converted to %20.)  However, the value will be HTML encoded.  (E.g., spaces are converted to %20.)

Example:

            NoUrlEncode:FDV:Birth Date

Returns:

            08%20December%2048%20A.D.%2000-00-00-AM

FK

Foreign Key Name

Returns the foreign key or foreign key ID.  The Foreign Key Name is the name of the foreign key either in the database or as a virtual foreign key defined in Iron Speed Designer.

Example:  FK:FK_Orders_Customers

FK may be prefixed by NoUrlEncode to indicate that the value will not be URL encoded.  (E.g., spaces will not be converted to %20.)

Example:  NoUrlEncode:FK_Orders_Customers

FV

Database field name
or
Field display name

Returns (converts) the database field value as a string without using the field’s display format.  For example, dates will always be displayed in the web server's default date format regardless of the field’s properties.  Value is the database field name (not the name of the code generation tag).

Example:

            FV:BirthDate

Returns:

            12%2f8%2f1948+12%3a00%3a00+AM
            (12/8/1948 12:00:00 AM)

FV may be prefixed by NoUrlEncode to indicate that the value will not be URL encoded.  (E.g., slashes will not be converted to %2f.)  However, the value will be HTML encoded.  (E.g., spaces are converted to %20.)

Example:

            NoUrlEncode:FV:BirthDate

Returns:

            12/8/1948%2012:00:00%20AM

FVS

Field display format

Database field name
or
Field display name

FVS returns (converts) the database field value as a string using the field’s “editable” or “reparsable” string format as specified by the database field properties.  This is the same as the FV type, but converted into a string.

Example:

            FVS:BirthDate

Returns:

            08+December+48+A.D.+00-00-00-AM

(08 December 48 A.D. 00-00-00-AM, assuming the display format is dd MMMM yy gg HH-mm-ss-tt)

FVS may be prefixed by NoUrlEncode to indicate that the value will not be URL encoded.  (E.g., slashes will not be converted to %2f.)  However, the value will be HTML encoded.  (E.g., spaces are converted to %20.)

Example:

            NoUrlEncode:FVS:BirthDate

Returns:

            08%20December%2048%20A.D.%2000-00-00-AM

PageCount

N/A

Returns the page count when used with a table control.

PK or ID

None

Returns the record’s primary key.

The “ID” substitution variable constructs a Key object, which is rendered as an XML structure to accommodate composite keys (where the key consists of more than one column).

Virtual foreign keys of database views cannot be used as a URL Parameter using ID.  Consider using FV instead.

Note: PK is an alias for the ID type.

TName

N/A

Returns the table name when used with a table control.

Using URL parameters in WHERE clauses

URL parameters can be used when selecting and displaying data in an SQL query.  A URL parameter can provide a value that is compared to the record's field value when that record is read at run-time.  Based on the comparison of the two, the record is either included in or excluded from the result set.  When Iron Speed Designer builds your application, it creates the “addFilter” mechanism that applies the comparison.

Use the Add WHERE Clause dialog in the Query Wizard (Data Sources tab, Edit…) to select the URL parameters to use in the query.

 

Using URL parameters to initialize field values

URL parameters can be used to initialize controls in Actions section of the Property Sheet.