Form Definition URL

Forms can be linked and run from outside of Process Director using a manually-configured URL (for example, linked from your Intranet portal). The default URL can be found on at the bottom of the Form Definition's Properties page, and looks similar to this:

https://ServerName.com/form.aspx?pid=PP&formid=NN&nohome=0&completepageprompt=0&completepage=&completetext=

Where ServerName is the hostname of BP Logix, PP is the internal ID of the Partition, and NN is the internal ID of the Form Definition. For users of Process Director v5.12 and higher, the URL is displayed on this tab as a hyperlink.

A number of URL parameters can be added to the URL's existing parameters to alter the way Process Director responds to the URL request. The URL parameters may be used in any order.

https://ServerName.com/form.aspx?pid=PP&formid=NN&nohome=1&completepageprompt=0

  • The nohome parameter controls whether the home page should be opened when the link to the Task List or Form is clicked. Set nohome to 1 to ensure that the home page isn’t opened.
  • The completepage and completetext parameters specify the URL of the page that completing the Form should redirect to and the text displayed with the URL, respectively. When using completepage parameter, you must include the "ServerName.com//" or "https://" when specifying your URL. In other words, the URL must be a fully-qualified URL, and not just a relative path or other partial URL. Additionally, the completepage URL must, for security reasons, point to a page inside the Process Director domain. You can't redirect to an external URL. We recommend that, if you want to direct users to an external URL, you create a custom redirect page inside the /custom folder of your process director installation, and use that page as the completepage URL. That custom redirect page can then, in turn, redirect the users to an external URL.
  • The completepageprompt parameter supplies the page completion prompt message. If completepageprompt=0, then the default "completed" page will NOT be displayed. If you are trying to redirect the user to a specific URL after the form is submitted, you'll most likely want to suppress the "completed" page.
  • The prinstid parameter supplies a process instance ID to display the form instance that is associated with a specific process instance.
  • The findtask=1 parameter will display the form in task context. This will generally open the form in the context of the current task. Some form instances, of course, may be associated with multiple process instances, so you can give an additional hint about the process you are trying to use by adding the linkprid parameter to pass the ID of the specific process instance which you want to open in task context.

Process Director v5.39 and higher adds additional URL parameters to control how the form responds to the Save and Close button, when used.

  • The saveformpage and saveformtext parameters specify the URL of the page that saving the Form should redirect to and the text displayed with the URL, respectively. The usage specifics of the completepageprompt and completetext parameters listed above also apply to this parameter.
  • The saveformpageprompt parameter supplies the page save prompt message. If saveformpageprompt=0, then the default "completed" page will NOT be displayed. If you are trying to redirect the user to a specific URL after the form is saved, you'll most likely want to suppress the "completed" page.

You can also set the value of Form fields in the URL that will default or override the values for the specified fields. For security reasons, you'll need to specify the fields you want to set via URL parameter beforehand. There are two methods for setting the value via a URL parameter.

Setting a default value

If you only need to set the default value of a field via URL for a new Form instance, you can use the following procedure to configure the field.

In the Form Fields tab of the Form definition, open the field properties for the field you wish to set. You must set a variable as the default value, and there are two ways to do this:

  1. Set the Default Value as a Variable, then enter the name you'd like to use for the variable:

  1. Set the default value to a string, and enter a generic variable into the field, using the syntax {VAR:VarName, modifier=ModifierValue}.

Using the VAR object in a text string enables you to add additional modifiers to the variable. For instance, the syntax {VAR:VarName, null="Value if null"} specifies the value to use if the URL parameter isn't present.

The VAR (Variable) object is an ad hoc variable whose primary use is to serve as a placeholder for the value passed via the URL Parameter. This is the same implementation procedure used when passing values to a Knowledge View in a URL.

No matter which of the two methods above that you implement, you can now use the Variable as a URL parameter. In the case of the above example, the Parameter would be

https://ServerName.com/form.aspx?pid=PP&formid=NN&Stuff=value

The default value will be filled with the value specified in the URL parameter.

This procedure is the simplest method for setting a field's value, and it doesn't require any further configuration. The drawback to this method is that it can only be used to set the default value of a field in a new Form instance, and so won't change a field value that has already been saved in an existing Form instance.

If you wish to set the value in an existing Form, you'll need to use the next method.

Setting a Field Value Universally

This method enables you to set a field value via URL parameter at any time. For security reasons, however, you must first identify the field by setting the field name as configurable via URL in the Custom Vars file (vars.cs.ascx), using the FormFieldsAllowDisabledURLUpdate method.

Once you've specified the field name in the Custom vars file, you can now use a URL parameter to set the value any time you desire. In the URL parameter, the field is identified using the prefix "EXT_ ", followed by the field name, to identify the field, e.g., "EXT_FieldName".

Important Be sure to URL encode the values you specify in the URL Parameter.

Example:

In the Custom Vars file, identify the fields to change via URL Parameter:

public override void PreSetSystemVars(BPLogix.WorkflowDirector.SDK.bp bp)
{
    //Fields to set via URL Parameter
    bp.Vars.FormFieldsAllowDisabledURLUpdate.Add("Field1");
    bp.Vars.FormFieldsAllowDisabledURLUpdate.Add("Field2");
}

Now, you can use the following URL parameters to set the field values:

https://ServerName.com/form.aspx?pid=PP&formid=NN&EXT_Field1=Some+Value&EXT_Field2=Another+Value