Show TOC

Procedure documentationFinding and Modifying References Locate this document in the navigation structure

 

When you rename or delete a field, or delete a view element (table or form), any references to the field or view element are broken, and may cause errors or unexpected model behavior. Field or element references can be found either in dynamic expressions, or as direct references, for example, in the From and To fields of a predefined action. Visual Composer provides a tool that enables you to search for references before you rename or delete a field or a view element, so that you can modify the reference accordingly and ensure that your application runs as expected.

You can search for references using the following procedures:

  • Finding All Expressions

  • Finding References to a View or Connector

  • Finding References to a Field

Procedure

Finding All Expressions

You can search for all expressions defined in a component. For example, expressions defined using the Dynamic Expression Editor dialog box, values entered in fields that can be edited using the Dynamic Expression Editor dialog box, references to fields and views defined in the Define Action dialog box, conditions defined in an operator dialog box, and so on. After displaying the list of expressions, you can sort them, review them, modify them, look for errors, and locate them on the Design board and Layout board.

  1. Make sure that the component in which you want to search is the active component (click its model tab to make it active).

  2. Choose   Tools   Find All Expressions  . Visual Composer searches through all the expressions in the component and displays them in the Find All Expressions dialog box.

  3. In the Find All Expressions dialog box, you can do the following:

    • Click a link in the Element column to highlight the selected element on the Design board or Layout board.

    • Click the button next to an expression to open the Dynamic Expression Editor dialog box, or other relevant dialog box (such as the Define Filter dialog box), and modify the selected expression. An expression that contains a syntax error is marked with an error icon.

      Note Note

      After you modify an expression, the expression is updated in the Find All Expressions dialog box, if you modified it using the Dynamic Expression Editor dialog box. If you modified it using another dialog box (such as the Define Filter dialog box), the expression is not updated and is displayed in gray. You can then click the Refresh button in the Find All Expressions dialog box to update it with the changes.

      End of the note.

    For more information about the options in the Find All Expressions dialog box, see Find All Expressions Dialog Box in the Visual Composer Reference Guide.

Finding References to a View or Connector

You can search for references to a view element (a table or form) or a connector. For example, a form may be referenced in a dynamic expression or in an action. This enables you to see where an element is in use, before you decide whether to delete it.

  1. On the Design board, right-click the view or connector and choose Find References from the context menu. Visual Composer searches in the component and displays all references to the selected element in the Find Element References dialog box.

  2. In the Find Element References dialog box, you can do the following:

    • Click a link in the Element column to highlight the selected element on the Design board or Layout board.

    • Click the button next to an expression to open the Dynamic Expression Editor dialog box, or other relevant dialog box (such as the Define Action dialog box), and modify the specific expression. An expression that contains a syntax error is marked with an error icon.

      Note Note

      After you modify an expression, the expression is updated in the Find Element References dialog box, if you modified it using the Dynamic Expression Editor dialog box. If you modified it using another dialog box (such as the Define Action dialog box), the expression is not updated and is displayed in gray. You can then click the Refresh button in the Find Element References dialog box to update it with the changes.

      End of the note.

    For more information about the options in the Find Element References dialog box, see Find Element References Dialog Box in the Visual Composer Reference Guide.

Finding References to a Field

You can search for references to a specific field. This search is useful to perform before you rename or delete a field, so you can first check where it is being used. After you find the references, you can choose to rename the field and update selected references with the new name, replace the field name in selected references with a different field name, or delete the field together with selected references.

  1. Right-click the view or connector element that contains the field you want to search for and choose Define Data from the context menu. The Define Data dialog box is displayed.

  2. Select the field whose references you want to find, and click the Find References (Find References) button in the toolbar of the Define Data dialog box. Visual Composer searches in the component and displays all references to the selected element in the Find Field References dialog box.

    Visual Composer only searches for references in the current component. If other components reuse this component and contain references to it, they are not displayed.

    Note Note

    When you rename or delete a field directly in the Define Data dialog box, a message box is displayed stating that this may result in unresolved field references. You can also open the Find Field References dialog box and handle these references by clicking the Find references link in this message box.

    End of the note.
  3. In the Find Field References dialog box, you can do the following:

    • Click a link in the Element column to highlight the selected element on the Design board or Layout board.

    • Rename the field and update selected references to it:

      1. In the list of found references, select the checkboxes of the ones you want to update with the renamed field.

      2. Select the Rename field radio button.

      3. In the New name field, enter a new name for the field.

      4. Click Rename. The field is renamed and any selected references are also updated using the new name.

    • Delete the field and delete selected references to it:

      1. In the list of found references, select the checkboxes of the ones you want to delete. You can only delete expressions that contain a reference to a single field, for example, =@NUM1 and =@Table1@NUM1.

      2. Select the Delete field radio button.

      3. Click Delete. The field is renamed and any selected references are also deleted. Note that this may result in controls being defined with empty values.

    • Replace the field in selected references with another field:

      1. In the list of found references, select the checkboxes of the ones you want to replace with a different field.

      2. Select the Replace references radio button.

      3. In the Replace with field, select the name of the field that you want to use. The fields in the dropdown list are those in the same dataset and of the same type as the current field.

      4. Click Replace. Any selected references are updated using the name of the specified field.

    • Click the button next to an expression to open the Dynamic Expression Editor dialog box, or other relevant dialog box (such as the Define Action dialog box), and modify a specific expression. An expression that contains a syntax error is marked with an error icon.

      Note Note

      After you modify an expression, the expression is updated in the Find Field References dialog box, if you modified it using the Dynamic Expression Editor dialog box. If you modified it using another dialog box (such as the Define Action dialog box), the expression is not updated and is displayed in gray. You can then click the Refresh button in the Find Field References dialog box to update it with the changes.

      End of the note.

    For more information about the options in the Find Field References dialog box, see Find Field References Dialog Box in the Visual Composer Reference Guide.