Dictionary.getFilledAttributes

Syntax

getFilledAttributes(forEdit: Boolean);

Parameters

forEdit. Indicates whether to get attributes that can be edited by user. If this parameter is set to true, only editable attributes are returned, otherwise the array of attributes that can be shown, is returned.

Description

The getFilledAttributes method gets the array of attributes that can be viewed or edited by the user.

Comments

This method returns an array of object with the following type:

Example

To execute this example, the page must contain the DictionaryBox component named dictionaryBox (see Example of creating the DictionaryBox component ). Determine IDs of editable attributes and their number:

// Get MDM dictionary
var source = dictionaryBox.getSource()[0];
// Get all dictionary attributes
var attributes = source.getAttributes();
// Get attributes available only for editing
var filledAttributes = source.getFilledAttributes(true);
var filledAttributesId = [];
for (var i = 0; i < attributes.length; i++) {
    filledAttributesId.push(attributes[i].getId());
};
console.log("IDs of all editable dictionary attributes: %s", filledAttributesId.toString());
console.log("Attributes number: " + filledAttributesId.length);

After executing the example, the browser console shows IDs of all dictionary attributes available for editing, and their number:

IDs of all editable dictionary attributes: KEY,NAME,PARENT_KEY,ORD,HIDDEN,VERSION,INDATE,OUTDATE,UNIT_VALUE,DESCRIPTION,UNITS_SYSTEM,
READACCESS,WRITEACCESS,DELETEACCESS,ACCESSACCESS,UNITS_SYSTEM_DESCRIPTION

Attributes number: 16

See also:

Dictionary