Passing Field Values in URLs

Passing Field Values between Pages

The parameters passed as part of the URL are not limited to the primary and foreign keys.  You can pass any field value, as well as display values using the URL Parameter types to pass any field value to a page via its URL.  For example, to pass the first and last names from an Employee record, specify the URL and the URL Parameters in the Button Action Wizard as follows:

Group

Property

Setting

[Application Generation]

Button actions

Redirect

Button Action Wizard

URL

ShowEmployeePhoto.aspx?First={FV:FirstName}&Last={FV:LastName}

Button Action Wizard

URL Parameters

FV:FirstName,FV:LastName

Advantages and limitations

There are many contexts in which passing data from one page to another via the URL is a convenient means of transferring data.  By dynamically constructing the URL, the component can choose the page to which the user will be redirected.  Also, using URL parameters, the component can pass data to the new page.  This works even for components on different pages.  However, because URLs are limited to a browser-specific maximum length, the quantity of data that can be passed to a new page is fairly limited.  Also, a redirect will cause the current page to stop processing immediately.  Therefore, some situations may require a combination of event interaction and page redirection.

Field values vs. display values

The display values might be different than the field values.  For example, for Boolean fields, the field value might be 1 or 0, but the display value might be True or False.

Example

This example passes the ID of an Order from a Show Order Details page to a Show Orders page to show how parameter passing of a field value works.

Step 1:  Open the ShowOrder_DetailsTable.aspx page and go to the Order_DetailsFields section of the page.

Step 2:  Drag a Link Button control from the Toolbox onto the page’s Table row section in the Page Layout Spreadsheet.

Step 3:  Select the newly added Link Button control and set these properties via the Property Sheet.

Group

Property

Setting

[Application Generation]

Button actions

Redirect

Step 4:  In the “Button actions” property, select the Redirect action and click “Edit…” to open the Button Action Wizard.

Step 5:  In the Button Action Wizard, set the URL to the corresponding page, ShowOrders.aspx in this case.

Step 6:  In the Button Action Wizard, add a URL parameter to pass the OrderID field value.

Step 7:  Build and run the application.

See Also

Using URL Parameters

URL Query String Format

Passing Primary and Foreign Key Values in URLs

Example: Passing a Record ID from an Add Record Page