How to access user-defined environment properties in JavaScript for Task Screen profile fields
search cancel

How to access user-defined environment properties in JavaScript for Task Screen profile fields

book

Article ID: 115957

calendar_today

Updated On:

Products

CA Identity Manager CA Identity Governance CA Identity Portal

Issue/Introduction

Environment variables defined as User Defined Properties in the Identity Management (IDM) Management Console (Home > Environments > [ENV] > Advanced Settings > Miscellaneous) are commonly reused in Java-based business logic, such as BLTH, EventListeners, and ParticipantResolvers.

When configuring JavaScript for a Task Screen Profile Field using FieldContext (or ScreenContext), a similar requirement may arise to load these environment properties within the script initialization logic.

Environment

Release: v14.5, v15

Resolution

User-defined environment properties can be retrieved in JavaScript during field initialization by calling getEnvironmentSettingsProvider() on the FieldContext object.

Use the following example syntax within the init function:

function init(FieldContext) {
    var Property_Value = FieldContext.getEnvironmentSettingsProvider()
                          .getEnvironmentUserDefinedPropertiesDefinition()
                          .getUserProperties()
                          .get("MY_USER_DEFINED_PROPERTY");
    // Additional logic here
}