Why do I receive the error 'Input string was not in a correct format' when my web form loads?

Issue

Why do I receive the error Input string was not in a correct format when my web form loads?

Cause

One of the more common reasons for this error is that the web control has a WorkflowGen field datatype (FieldDataType) extended attribute specified that does not match the value type stored in the form data file.

For example, the following control has the FieldDataType extended attribute set to Currency:

<asp:Label ID="REQUEST_AMOUNT" runat="server" FieldDataType="Currency" ></asp:Label>

In the form data, REQUEST_AMOUNT contains a non-numeric value or, most often, a number with a comma, e.g. 20,000.

The error normally occurs when updating an existing web form while there are other requests using the that same web form.

Solution

If the FieldDataType extended attribute is required, create a new version of the process and apply this FieldDataType condition to new requests only.