Editor How-To
Data Source – Legal Name
Updated on: December 19, 2022
The data-source attribute can be used to query for the subject of the record’s full legal name, just legal first name, and just legal last name. This may be useful when displaying the subject of the record’s name on a form, or in order to provide a report with their legal name. Setting this up will require a query field, as well as some custom code. There are two methods of collecting the subject of a record’s legal name, either having the field stay current/update if their legal name changes, or having it save their legal name at the time of record creation or the implementation of this functionality.
Terms
Term | Description | |
---|---|---|
1 | Content Attribute | This will refer to one of the following attributes based on the desired language. English: content_en-CA, French: content_fr-CA, Spanish: content_es-US. |
2 | Data Field | Data fields are hidden from view, store information, and may be referred to by form functions. They will be created outside of the tabset so that they are always initialized |
3 | Dynamic Tab(s) | Dynamic tabs are tabs that are not initialized on form load. All tabs but the first tab are dynamic tabs. |
4 | Query Field | A Query field acquires data on form load based on a query. Common queries can be found using the data-source attribute while custom queries can be created by members of clevr’s product services team. |
5 | id | This is a common form attribute. When an id is used in the example, an alternative id may be used, however, make sure that when replacing the example’s id with a custom one, the change is consistent throughout. |
6 | class | This is a common form attribute. When a class is used in the example, an alternative class may be used, however, make sure that when replacing the example’s class with a custom one, the change is consistent throughout. |
Form Work – Update to Current Name
Setting up the fields to query the subject of the record’s legal name involves the use of the data-source attribute being applied to a textbox. The queried value will then be carried over to another textbox and saved. This is necessary as the query itself does not save the value to the field, but simply displays the queried value.
Query Field Setup
- The query field will be set up as a data field in order to store the information pulled in by the query. Start by creating a container outside of the tabset.
-
On this container, add a style of “visibility:hidden;background:aliceBlue;border:1px solid steelBlue;”
-
Place a textbox or Common: Label | Textbox custom type into this container.
- Give the label a descriptive content attribute, such as “Queried Legal Full Name”.
- On the textbox itself, add the attribute data-source and in value column, click on the drop-down and select either “Textbox: Person’s Legal Name”, “Textbox: Person’s Legal First Name”, or “Textbox: Person’s Legal Last Name”, depending on what you would like imported. Also be sure to give the textbox a description.
- Next, give this field an id. The id used in this example will be “qLegalFullName”.
- Lastly add the class “unhook”.
Data Field Setup
- The field that will store the data should be a data field held within the same data field container as the query field (the blue container). This is so that the data field will always be initialized and able to store the legal name when entering a record.
- Place a textbox or Common: Label | Textbox custom type into the data field container.
- Give the label a descriptive content attribute, such as “Data Legal Full Name”.
- Give the textbox an id. The id used in this example will be “dataLegalFullName”. Also give this textbox a description.
Functionality – Update to Current Name
Add the following code to the after-tab-load attribute of the data field.
Form Work – Maintain Initial Name
If updating the field when the legal name is changed is not a concern / is an undesired functionality, it is possible to maintain the initial legal name loaded onto the record.
Query/Data Field Setup
- In the case of maintaining the initial name, the query field will also be the data field. Start by creating a container outside of the tabset.
-
On this container, add a style of “visibility:hidden;background:aliceBlue;border:1px solid steelBlue;”
- Place a textbox or Common: Label | Textbox custom type into the data field container.
- Give the label a descriptive content attribute, such as “Queried Legal Full Name”.
- On the textbox itself, add the attribute data-source and in value column, click on the drop-down and select either “Textbox: Person’s Legal Name”, “Textbox: Person’s Legal First Name”, or “Textbox: Person’s Legal Last Name”, depending on what you would like imported.
-
Give the textbox the attribute preventQueryOnValue with a value of “true”, the class “unhook”, and a description.
This field should now only run the query if the field is empty, and then save that value.
Adding to a Report
In order to add the data field to a report, simply add it as any other element. This is done by surrounding the ElementID of the data field with braces.
ex: {638067844736318626}