Friday, March 6, 2015

Set Option Set by OptionSet Text

function SetValue(optionsetAttribute, optionText)
{
 var options = Xrm.Page.getAttribute(optionsetAttribute).getOptions();
 for(i = 0; i < options.length; i++)
 {
  if (options[i].text == optionText)
   Xrm.Page.getAttribute(optionsetAttribute).setValue(options[i].value);
 }
}

Calling of the function

SetValue("new_country", "India")

No comments:

Post a Comment

Get files of last hour in Azure Data Factory

  Case I have a Data Factory pipeline that should run each hour and collect all new files added to the data lake since the last run. What is...