Skip to content

Latest commit

 

History

History
81 lines (52 loc) · 3.83 KB

configure-form-accept-custom-querystring-parameters.md

File metadata and controls

81 lines (52 loc) · 3.83 KB
title description ms.custom ms.date ms.reviewer ms.suite ms.tgt_pltfrm ms.topic applies_to ms.assetid caps.latest.revision author ms.author search.audienceType
Configure a form to accept custom querystring parameters (Developer Guide for Dynamics 365 Customer Engagement) | MicrosoftDocs
Learn about configuring a form to acept custom querystring parameters. Use these parameters to set default values when you create a new record in the application.
10/31/2017
pehecke
article
Dynamics 365 Customer Engagement (on-premises)
6c05ff14-2d5a-4e90-a3c4-dc7ca1ec4698
19
JimDaly
jdaly
developer

Configure a form to accept custom querystring parameters

The ability to pass values to a Web page by using query strings represents a concern for security. [!INCLUDEpn_microsoftcrm] applies the best practice of always comparing any parameter passed as a query string against a list of expected parameter names and data types.

By default, [!INCLUDEpn_microsoftcrm] allows a specified set of query string parameters to be passed to a form. You use these parameters to set default values when you create a new record in the application. Each parameter must use a standard naming convention that includes a reference to the attribute logical name. For more information, see Set field values using parameters passed to a form.

In your applications, you may want to pass custom query string parameters to an entity form. This topic provides information about how you can define a set of specific parameter names and data types that can be accepted for a specific entity form.

Define allowed query string parameters

There are two ways to specify which query string parameters will be accepted by the form:

  • Edit form properties

  • Edit form XML

Edit form properties

When you edit an entity form, on the Home tab in the Form group, click Form Properties. In the Form Properties dialog box, select the Parameters tab.

Use this tab to modify the names and data types that the form allows.

Edit FormXml

Within the exported solution customizations.xml file, immediately following the footer element, you can add a <formparameters> element. In the <formparameters> element, add <querystringparameter> elements to specify which parameters will be allowed.

The following describes the querystringparameter element attributes, name and type:

  • name. Each name attribute must contain at least one underscore ('_') character, but the name of the query string parameter cannot begin with an underscore. The name also can’t start with “crm_”. We strongly recommend that you use the customization prefix of the solution publisher as the naming convention. A valid querystringparameter name attribute value is “myISV_contact_specialvalue”.

    [!IMPORTANT] If a querystringparameter element name is not unique, it may be overwritten by another parameter definition using a different data type.

  • Type. Match the data type values with the parameter values so that invalid data is not passed with the parameter. The following are valid data types:

    • Boolean

    • DateTime

    • Double

    • EntityType

    • Integer

    • Long

    • PositiveInteger

      [!NOTE] PositiveInteger includes “0” in the range of valid values.

    • SafeString

    • UniqueId

    • UnsignedInt

See also

Set field values using parameters passed to a form
Open Forms And Views with a URL

[!INCLUDEfooter-include]