Deep dive: Combined entity form
| Warning | Work in progress! We are in the process of updating the information on this page. Subject to change. |

Traditionally, entity forms display details about a single entity record. One notable exception is common in field service scenarios, where the work order form and the bookable resource booking form are often combined into a single form. Resco Mobile CRM offers support for combined entity form in field service out of the box. Would it be possible to create custom combined forms?
Possible solutions
Resco Mobile CRM does not directly support designing a form for two entities or embedding a portion of one form into another one. However, there are several ways to accomplish similar behavior, with varying degrees of complexity. In these examples, we assume that one of the two entities is primary, where most of the action happens, while the other is mostly here for convenience, often read-only, providing extra information so that users don't have to navigate away from the main form.
- Use shared variables to display fields from the related entity.
- Usually, this approach would be read-only; modifying the shared variables and saving changes to the related entity would bring extra complexity.
- Create a custom view of the related entity and add it to the form
- Add an unrelated list to the form, displaying only a single record.
- Use Resco JavaScript Bridge to add a custom iframe to the main form.
- Here, the degree of control over the related entity depends on the skill of the JavaScript developer. Custom development is very powerful but can be expensive.
In the examples below, we are working with the standard entities Account and Contact. We want to enhance the Contact form with information about the parent account record.
Combined form using editable view
A list of associated or unrelated records is a standard component that you can add to forms. In this approach, we create a custom view for the parent account that displays exactly one record. We make it larger and editable to fit all the necessary fields. Finally, we add it to the form.
Create a new view for the parent entity
- Edit an app project in Woodford and go to the Account entity.
- Create a new view. Let’s hide it in the view selector. Users cannot select such views manually; they are only used when explicitly selected in Woodford.

- Add some extra height to the row to display all the fields that you need.
- Add additional cells for labels (set Type to "Constant" and enter the label).
- If you want to make the cells editable, change the Kind to "Text-DirectEdit".

- Click Multi Select and disable it. This is just to prevent unexpected behavior in the view when users tap and hold.
- The standard behavior for views is that when you tap any row, the record's form is displayed. If you want to disable the behavior, click Button Click and use the following rule:

- Save and close the view.
Add view to form
- Go to the Contact entity and edit its form.
- Add an unrelated entity list to the form and select the Account entity.

- Select the new list and on the Properties pane, enter a suitable Name, e.g. "Parent account". Set the Height to "1" - just tall enough to display one record.
- Expand the new list and click Properties. In the Unrelated Tab Properties, select the view you created in the previous step. Click Edit Filter and select the right record to display.

- To ensure that the list shows the correct Account record when you change the Contact's parent on the form, add an On Change rule.

- Save all changes and publish the project.
Behavior in the app
In this approach, users can edit the parent account details directly from the contact form. Changes to the account are saved immediately (thanks to Kind set to "Text-DirectEdit"). The Save button saves changes to the contact details. If you want edits to the parent account trigger On Change events for the contact form, enable Trigger OnChange event for the list.
We have dealt with some of the possible pitfalls that you can encounter, e.g. multi-selection of view records or the tap behavior. Additional things you might want to disable are flipping the list into a map/calendar or creating new account records from the list. See Associated tab properties > Properties tab.
TBD