Dictionary.getParameters

Syntax

getParameters();

Description

The getParameters method returns an array of MDM dictionary parameters in metadata format.

Comments

This method returns an array of JSON objects with the following fields: id - parameter ID, k - parameter key, n - name, predefined - ID of predefined parameter related to the given parameter, vis - indicates if parameter is visible.

Example

To execute this example, the page must contain the DictionaryBox component named dictionaryBox (see Example of creating the DictionaryBox component ). Determine MDM dictionary parameters that can be shown:

// Get MDM dictionary
var source = dictionaryBox.getSource()[0];
// Get dictionary parameters
var parameters = source.getParameters();
if (source.hasVisibleParams()) {
    console.log("Dictionary parameters:");
    for (var i = 0; i < parameters.length; i++) {
        console.log("Parameter ID: %s, name: ", parameters[i].id, parameters[i].n);
    };
} else {
    console.log("The dictionary does not contain parameters that can be shown");
};

After executing the example the browser console shows IDs and names of MDM dictionary parameters that can be shown:

Dictionary parameters:

Parameter ID: CURDATE, name:  Validity date
 

An appropriate notice is shown in the browser console if the dictionary does not contain parameters that can be shown.

See also:

Dictionary