When you add a URL to a query, for the parameter values you can pass in any data from the records that are returned by the query. For example, if your query selects Asset records from the database, you could pass data from the Asset records to the URL parameter values. In this case, you will use a $ (dollar sign) to specify that the parameter value is variable.
For example, consider a query that returns a list of Pumps in the database. You could construct a URL for the Asset ID column of the query so that in the query results, a link would appear to open each record in the Record Manager. In this case, instead of specifying a particular Entity Key in the URL to create a static link that would open the same record every time, you would need to specify a variable parameter value so that the URL would be populated with the appropriate Entity Key, depending upon which specific results were returned by the query. The URL that you would add to the Asset ID column in the query would look like this:
meridium://Registry/RecordManager?EntityKey=$EntityKey$&FamilyKey=$FamilyKey$
This URL contains two variable parameter values, which are shown in blue:
$EntityKey$, which will be replaced with an actual Entity Key in the link.
$FamilyKey$, which will be replaced with an actual Family Key in the link.
Note that each variable value is denoted by dollar signs that surround the variable name. Typically, the variable name will be the Alias for a field in the query but may vary depending on how the query has been configured. In this example, the variable names Entity Key and Family Key correspond to the Aliases for system fields and will be replaced with actual Entity Keys and Family Keys when the URLs are constructed at run time. You will need to choose a variable that is supported and is appropriate for the URL parameter.
Note: Whenever you pass in a value from a field that is included in the query results, you can use the Alias between the dollar signs, provided that an Alias has been defined. If an Alias is not defined, you can pass in the field ID. We recommend, however, that you define Aliases for every field that will be included in the results. Because Aliases must be unique, this helps eliminate ambiguity in cases where a query uses multiple tables and contains more than one hyperlink, each of which accepts similar values from different tables.
While our example shows how you can pass variable Entity Keys and Family Keys in as URL parameter values, note that you can pass in ANY value that is included in the query and is appropriate for the URL. For example, if your query includes a URL that uses the AssetID parameter, you could pass in a variable Asset ID as the parameter value. You might also pass values from the query results to query prompts in order to link from one query to another.
Note the following about passing variable values in to hyperlinks in queries:
When passing in a non-system field as a variable, you must surround the field ID with square brackets. For example, to pass in the value from the Asset ID field, you would need to type $[Asset_ID_CHR]$ as the variable parameter.
When running a query in Unformatted mode, you must include in the output ANY field that you want to use as a URL parameter value. This rule applies both to system and non-system fields. In our example, to run our query in Unformatted mode, we would need to include FMLY_KEY and ENTY_KEY as columns in the query and select the Display check box to display each column in the output.
When running a query in Formatted mode, you can pass system fields in as parameter values without including them in the query results. Non-system fields, however, must always be included in the query results in order to be used as hyperlink parameter values.
Note: If you omit a system field from the results and still want to pass the values in to a URL parameter, use the field ID instead of the Alias within the dollar signs (e.g., $ENTY_KEY$).
When your query contains multiple tables and you want to use a hyperlink that accepts one or more parameter values, the Meridium APM system will need to know what the source table is for each parameter value.
For fields included in the query results, you can use the Alias. Since each Alias must be unique, the Meridium APM sytem will be able to determine the source table from the field's Alias.
For system fields not included in the query results, use one of the following syntax options, depending upon whether or not a table Alias has been defined:
$[TableCaption].FieldID$ where TableCaption is the default caption of the table (if a table Alias has not been defined).
$TableAlias.FieldID$ where TableAlias is the Alias of the table (if a table Alias has been defined).
Copyright © 2017 General Electric Company. All rights reserved.