Pre-population Validation Checks

<< Click to Display Table of Contents >>

Navigation:  Collect > Troubleshooting >

Pre-population Validation Checks

Form Lookup Field Errors

Parent Form Error

 

The user is alerted of any errors in the pre-population when opening a form created from a template in test mode in Collect Mobile. Two types of pre-population errors within the Data Form are described below.

 

Form Lookup Field Errors

 

The validation checks will alert the Collect Mobile user to two types of errors related to Form Lookup fields. While the template can still be published and used, the Form Lookup field throwing errors will not have the expected values.

 

These Form Lookup field errors are explained below and detailed in the example images. The Collect template setup used in the example and the correct pre-population data mapping are provided in the following illustrations.

 

Col-Form-Lookup-Setup

 

Error Type 1: ID does not exist or is not valid

 

An error is thrown if the user:

Pre-populates the Form Lookup Field with an invalid ID (i.e., a text value rather than an ID).

Pre-populates the Form Lookup Field with an ID for a form that does not exist.

 

Col-Form-Error-1

 

An example of the error message that would be displayed is: "The parameter with name [FIELD NAME] of type for lookup in the form with ID [ID OF FORM WITH ISSUE] of type [FORM TYPE] references a form with ID of [ID OF FORM TO WHICHTHE FORM LOOKUP POINTS] which does not exist."

[FIELD NAME]: This is the Form Lookup field that is present on the form.

[ID OF FORM WITH ISSUE]: This is the #ID value of the form that contains the Form Lookup field.

[FORM TYPE]: The name of the form to which the lookup is pointing, defined as the Form Type when creating the field.

[ID OF FORM TO WHICH FORM LOOKUP POINTS]: The ID of the form to which the Form Lookup is pointing. This should match the [FORM TYPE] but does not, and therefore, an error is thrown.

 

Error Type 2: ID is pointing to wrong Form Type

 

During creation of a Form Lookup field, the Form Type is set to designate which form the lookup is pointing. When the Form Lookup field is pre-populated and the ID used points to a Form Type that is different from the designated form, an error is thrown.

 

Col-Form-Error-2

 

An example of the error message that would be displayed is: “The parameter with name [FIELD NAME] of type form lookup in the form with ID [ID OF FORM WITH ISSUE] of type [FORM TYPE] references a form with ID [ID OF FORM TO WHICH THE FORM LOOKUP POINTS] of type [WRONG FORM TYPE] which does not match the specified form type for the field.”

[FIELD NAME]: This is the Form Lookup field that is present on the form.

[ID OF FORM WITH ISSUE]: This is the #id value of the form that contains the Form Lookup field.

[FORM TYPE]: The name of the form to which the lookup is pointing, defined as the Form Type when creating the field.

[ID OF FORM TO WHICH FORM LOOKUP POINTS]: The ID of the form to which the Form Lookup is pointing. This should match the [FORM TYPE] but does not, and therefore, an error is thrown.

[WRONG FORM TYPE]: The name of the Form type to which the ID is pointing.

 

 

Parent Form Error

 

The validation checks will alert the Collect Mobile user to two types of errors related to Parent-Child form linking within Collect. While the template can still be published and used, the Child record(s) will not be visible under their Form list but can be used in any references.

 

These Parent-Child form linking errors are explained below and detailed in the example images. The Collect template setup used in the example and the correct pre-population data mapping are provided in the following illustrations.

 

Col-Parent-Form-Setup

 

Error Type 1: ID does not exist or is not valid

 

An error is thrown if the user:

Pre-populates the #parent_#id value with an invalid ID (i.e., a text value rather than an ID).

Pre-populates the #parent_#id value with an ID of a form that does not exist.

 

Col-Parent-Form-Error-1

 

An example of the error message that would be displayed is: “Form with ID [ID OF FORM WITH ISSUE] of type [FORM TYPE] references parent form of type [PARENT_FORM TYPE] with ID [PARENT_ID] which does not exist.”

[ID OF FORM WITH ISSUE]: This is the #id value of the child form.

[FORM TYPE]: The form type of the child form.

[PARENT_FORM TYPE]: The form type to which the #parent_#id is pointing.

[PARENT_ID]: This is the ID to which the #parent_#id is pointing.

 

Error Type 2: ID is pointing to wrong Parent Form

 

The user defines the #parent_#id and #id of the child-parent relationship during template setup. If the child #parent_#id points to a record that is not of the same parent type as defined in the template, an error is thrown. A common example of this is when pre-populating records ID data with low numbers. Collect assigns records with IDs starting at 1 and continues to increment when generating records during the pre-population phase. This could result in multiple records with the same ID and cause the parent-child link to point to the wrong record.

 

Col-Parent-Form-Error-2

 

An example of the error message that would be displayed is: “Form with ID [ID OF FORM WITH ISSUE] has parent ID [PARENT_ID] which is of type [FORM TYPE], expected type [PARENT_FORM TYPE].”

[ID OF FORM WITH ISSUE]: This is the #id value of the child form.

[PARENT_ID]: This is the ID to which the #parent_#id is pointing.

[FORM TYPE]: The form type of parent record to which the ID points.

[PARENT_FORM TYPE]: The expected form type that is defined in the template setup.