Enable Custom SQL Dropdown List

In addition to the other custom attributes that can be added to RiskVision objects users can also add a dropdown list that is populated based on an SQL query. This list can be added to any object in RiskVision, but it must first be enabled.

To enable the SQL dropdown list:

  1. Log in to RiskVision.

  2. Create a role and enable the Tenant Configure and Tenant Configure UI permissions.

  3. Assign the currently logged in user to the role.

  4. Log out and back in again.

  5. Click Configure UI in the top right corner and click OK.

  6. Open the object you wish to add the dropdown to.

  7. Drag and drop a custom string attribute into the object. 

  8. Export the UIComponent-Ticket.xml, append the customization file as below, and save the file:

    • <attribute id="customAttributes.string3" displayName="CustomAttribute" tooltip="" required="false" hidden="false" editable="true" changedOnly="false" type="sqloptionscombobox" queryName="assetOptions" sendObjectId="true" origin="user" order="13"></attribute>
  9. Import the UIComponent-Ticket.xml file.

  10. Navigate to the %AGILIANCE_HOME%\Tomcat\webapps\spc\WEB-INF\classes\sqlQueries.xml file.

  11. Place the below query at the bottom of the page and save it:

    • <query name="assetOptions">
           <sql><![CDATA[
               SELECT DISTINCT asset.NAME FROM agl_ticket tkt
               INNER JOIN agl_ticketobject objAsset
                   ON objAsset.ticket_id = tkt.ticket_id
               INNER JOIN agl_asset asset
                   ON asset.asset_id = objAsset.object_id
               WHERE tkt.ticket_id = :aglModelId
           ]]></sql>
        </query>
  12. Restart the tomcat service.

  13. Log in to RiskVision again.

  14. Navigate to the object in step 6.

  15. Click on the dropdown of the custom string from step 7 which will display data based on the query written in sqlQueries.xml.