<< Click to Display Table of Contents >> Navigation: Collect > Troubleshooting > Pre-population Validation Checks |
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Copyright © 2024 EarthSoft, Inc. • Modified: 20 Sep 2024