Table of Contents

Form to Form Configuration

Overview

Forms within clevr can be linked for form to form integration with the Form Management module. Form to form integration allows data to be pushed or pulled between forms. With form to form push integration, users enter data into the “source” form, then push the data over to the “target” form based on a workflow item on the form. For form to form pull integration, users open the target form and trigger Integration > Import Data to pull the data into the target form from the source form.

Key Terms

# Term Description
1 Target* This is a prefex for items on the form which will be recieving information.

ex: Target Form – The form which recieves information

2 Source* This is a prefex for items on the form which the information comes from.

ex: Source Form – The form which the information comes from.

Form to Form Push Items

# Element Use
1 Repeater  When setting up form to form push, elements 2-5 must be contained in a repeater. If there is a requirement that only one person should be selected, then you can remove the action buttons on the repeater by adding the code $(“.repeatAdd, .repeatDelete”, this).hide(); on the docready attribute of the container with repeatable = true.
2 Person Name Autocomplete This will be the field in which a person is selected.
3 Record ID Text Box This field will store the record ID when a new record is created by the “Create New Record Check Box”.
4 Person ID Text Box This field will store the person ID of the person selected in the “Person Name Autocomplete”.
5 Create New Record Check Box This Checkbox will hold the functionality of creating a new record or a specified form for the person who’s ID matches that in the “Person ID Text Box”.

The following tables will outline the attributes of the form to form push items. As always, also be sure to include a description on all fields.

Person Name Autocomplete

# Attribute Value
1 Class isAutocompleteFromServer unhook
2 id

This attribute can have any value but it is important that it is included.

ex: studentAuto

3 acquery This will hold the query for the persons you want selectable in the autocomplete.
4 searchFields This will hold the fields displayed in the student autocomplete from the queried tables. A required searchField is the person’s ID. This will be exported into the “Person ID Text Box” using the setOtherFields attributes.
5 setOtherFields true

Record ID Text Box

# Attribute Value
1 Class recordIdForNewForm
2 style visibility:hidden;

Person ID Text Box

# Attribute Value
1 acQueryFieldName personsIDForNewForm
2 acQuerySource This will be the element ID of the “Person Name Autocomplete”.
3 class personIdForNewForm
4 style visibility:hidden;

Create New Record Check Box

# Attribute Value
1 docready $(this).disableCheck();
2 onclick

To create records without a location restriction: $(this).createNewRecord(TARGET_FORM_ID);

To create records with a location restriction: $(this).createRecord(TARGET_studentInitiativeId, ‘TARGET_contextId’, true, true, ‘{e}’);

3 class recordSet
4 onRepeaterAdd $(this).disableCheck();

Form to Form Pull Items

When using form to form push, the target form must also be set up for form to form pull. This is completed by adding attributes/values to the elements on the target form.

Note: When drop-down lists are involved with form to form, it is important to note that the target drop-down and the source drop-down must have the exact same optionsList. It is also important that any elements within a repeater on the source form, must also be in a repeater on the target form.

# Attribute Description
1 clevrIntegrationField This will hold the element ID of the corrusponding field on the initial form.
2 clevrIntegrationForm This will hold the form ID of the initial form.

Exporting / Importing The Data

Now that the target and source forms’ elements are set up to create a record/receive data properly, functionality is required to initiate the data transfer. In the case of form to form pull, this is simply the “Import Data” option under the integration menu in the nav bar.

In the case of form to form push, on the other hand, a triggering element is required. The simplest way to do this is through the implementation of a “Transfer Data to Persons” button.

Transfer Data to Persons Button

# Attribute Value
1 content

This will be the text on the button.

ex: Transfer Student Data

2 onclick

$.transferRecordsToOthers(TARGET_studentInitiativeId, “REPEATER_ID“,true);

The REPEATER_ID parameter is replaced with the element ID of the container in the repeater which has the attribute repeatable = true.

The third parameter (true) is for if there needs to be a location check or not. If “$(this).createNewRecord(TARGET_FORM_ID);” was used on the “Create New Record Check Box” then this parameter should be set to true, however if “$(this).createRecord(TARGET_studentInitiativeId, ‘TARGET_contextId’, true, true, ‘{e}’);” was used, then it should be left blank – $.transferRecordsToOthers(TARGET_studentInitiativeId, “REPEATER_ID“);

Final Step

The final step for both form to form push and form to form pull is to link the source and target forms in the form management module. To do this, go to the form management module for the source form. Next, navigate down to the “Link Form” section and click on “NEW LINK”.

In the resulting popup menu, select the target form from the “Target Form Name” drop-down. Then, if setting up for form to form pull, check the first checkbox. If setting up for form to form push, check both checkboxes. Finally, click SAVE.

Alternative Solution For Same Person Push

If form to form push is being set up to only send to the same person of the record (student A to student A), then the autocomplete is unnecessary (and can be added in later if needed). In place of the autocomplete, an updated function will be called on the “Create New Record Check Box” which will set the value of the “Person ID Text Box” to the subject of the form. All elements must still be inside a repeater and may look similar to the image below.

Alternate Form to Form Push Items

# Element Use
1 Repeater When setting up form to form push, elements 2-4 must be contained in a repeater. For this alternate version of form to form, it is recommended that the action buttons on the repeater are removed by adding the code $(“.repeatAdd, .repeatDelete”, this).hide(); on the docready attribute of the container with repeatable = true.
2 Create New Record Check Box This Checkbox will hold the functionality of setting the value of the “Person ID Text Box” as well as creating a new record for a specified form for the subject of the source record.
3 Record ID Text Box This field will store the record ID when a new record is created by the “Create New Record Check Box”.
4 Person ID Text Box This field will store the person ID of the subject of the form.

Create New Record Check Box

# Attribute Value
1 docready $(this).disableCheck();
2 onclick

To create records without a location restriction: $(this).createNewRecord(TARGET_FORM_ID);

To create records with a location restriction: $(this).createRecord(TARGET_studentInitiativeId, ‘TARGET_contextId’, true, true, ‘{e}’);

It is recommended to utilize the location restriction as it will prevent users from creating records for people at locations which they do not have access to.

In addition to the previous function call, also include the following:

Copy to Clipboard

3 class recordSet
4 onRepeaterAdd $(this).disableCheck();

Record ID Text Box

# Attribute Value
1 Class recordIdForNewForm
2 style visibility:hidden;

Person ID Text Box

# Attribute Value
1 id newRecordPersonId
2 class personIdForNewForm
3 style visibility:hidden;

Final Steps

To finish up the alternative solution for same person push form to form, follow these same steps as the standard form to form push: “Form to Form Pull Items”, “Exporting / Importing The Data”, “Transfer Data to Persons Button”, and “Final Step”. Or more simply, follow the steps from “Form to Form Pull Items” up to and including “Final Step”.