Mobile configuration

After the Rest Services configuration has been updated, the agency must edit the Mobile configuration to add the custom fields to the mobile app. First the agency data must be added to the appropriate mobile model, and then the fields will be added to the appropriate view.

Mobile models

First, add a model for the agency table. In this case the model will be linked to the CDR_CodeEnforcement_Inspection model, so the agency adds it to the CodeEnforcement category. The model requires these attributes:

Attribute Description
ID The ID for the model can be anything the agency chooses. It will be used to refer to the model elsewhere. In this case the agency again uses the same name as the agency object, InspectionDetail.

Next, add a model property to the Properties node under the CDR_CodeEnforcement_Inspection model. As in the Rest Services configuration, a model property in the Mobile configuration can be used to link one model to another. For this node these attributes are required:

Attribute Description
ID Specify an ID for the property.
Foreign Key The Foreign Key is used to establish the relationship between the model you defined for the agency table and the inspection model. In this case the value is "Inspection."
Model Specify the ID of the model that you defined in the previous step.

This is all that is required to set up the models in the Mobile configuration. Because the CDR_CodeEnforcement_Inspection model is linked to the Rest Services models that you previously extended, the mobile app can access the agency data through those models.

Mobile views

In this example the agency wants to add the custom fields below the Location field in both the inspection viewer and the new inspection form. In the viewer the basic inspection data is displayed on the Summary tab, so the agency must edit the CDR_CodeEnforcement_Inspection_RecordView_Summary view. Under the View node, the controls that must be edited are nested several levels deep, following this path.

Controls > GroupBox: gbRecordTabSummary > Controls > GroupBox: gbMainContainer > Controls > GroupBox: gbInspGroup > Controls

The view for the new inspection form is CDR_CodeEnforcement_Inspection_New_Content. Again, the controls to be edited are nested several levels deep under the View node.

Controls > GroupBox: gbContent > Controls > GroupBox: gbInspGroup > Controls

In each view, the node for the Location field is displayed under the last Controls node listed, and is labeled Textbox: txtLocation. To add the agency field, add two text boxes below this node. Each text box requires these attributes:

Attribute Description
ID Specify an ID for the text box.
Title Specify the title that is displayed next to the field in the mobile app.
Bind Specify the property of the agency table that the text box is bound to. The property is accessed through the model that you defined for the agency table, so the bind consist of the model name followed by the property name, such as InspectionDetail.CodeSection.
Data Type Specify the data type of the agency property, such as System.String.

Finally, in addition to the two agency fields, you must add a hidden text box for the primary key of the agency object. This forces the services to include the agency table when sending data to the mobile device. The hidden text box should have these attributes:

Attribute Description
ID Specify an ID for the text box.
Bind Specify the name of the property that serves as the primary key for the model that is bound to the agency table. In this case the model ID is not required, so you just specify the name of the property, such as Key.
Data Type Specify the data type of the agency property, such as System.String.
Visible Set to False so the text box is not displayed in the mobile app.

Testing

After the Mobile configuration is saved, you should see the two agency fields in the mobile app. You must use the development tools to synchronize the metadata on the mobile device. This will download the latest configuration updates to the local device.