[ad_1]

We might have got a scenario to use the Environment Variable Value in the JavaScript in Dynamics 365 CE.
In this article, will explain about retrieving the Environment Variable current Value using JS.
Follow the below example.
Example: Create an Environment Variable and Show the value on Onload of Account record.
1.Created the below Environment Variable with Current Value.
Copy the Name of the Environment Variable and will use the same in the next step.

2.Below is the code used on the Account.js web resource.

Pass the Environment Variable Name to the function.
GetEnvironmentVariableValue(“Name of the Environment Variable”);
Code Snippet:
Below is the final code.
// JavaScript source code
function ShowAlertDialog(message, title, hgt, wdh) {
const alertStrings = { confirmButtonLabel: "OK", text: message, title };
const alertOptions = { height: hgt, width: wdh };
Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then(
...
[ad_2]
Source link


