{Energy Script}Add Dynamic choices in an possibility set in Mannequin pushed Apps

Overview:

On this article, we’re going to see the best way to create a customized possibility set discipline and add dynamic choices to the customized possibility set utilizing JavaScript.

Step 1: Create an Possibility set discipline and add one possibility.

Step 2: Declare an array and Retailer three values.

Step 3: Write the script beneath.

perform setOptions(executionContext)

{

var formContext = executionContext.getFormContext();

var optionCode = formContext.getControl(arg);

optionCode.clearOptions();

countryArray = [“India”,”Singapore”,”Malaysia”];

var index = 1;

for (var i=0; i< countryArray.size; i++)

{

var Identify = countryArray[i];

var obj = {};

obj[“text”] = Identify;

obj[“value”] = index;

optionCode.addOption(obj);

index = index + 1;

}

}

Step 4: Deploy the Internet useful resource and add the perform on the OnLoad occasion of the shape.

Output:

clip_image004

Hope it helps and Energy 365ing as regular!

Any downside in Energy Platform or Dynamics 365 – finish consumer, Microsoft accomplice or a person?

Downside Space – Technical, Useful, Coaching, Improvement or consulting?

I’m right here to assist, get in contact right here: Click here

clip_image010

LEAVE A REPLY

Please enter your comment!
Please enter your name here