Hey All,
I am using the following code to set the value of an option set field based on the input values from a multi option set field. I receive the error saying "TypeError: formContext.getAttribute(...).SetValue is not a function at SetMultiSelValues "
Error Log:
TypeError: formContext.getAttribute(...).SetValue is not a function
at SetMultiSelValues (ssgrp.crm8.dynamics.com/.../new_MultipOptionset)
at eval (eval at RunHandlerInternal (ssgrp.crm8.dynamics.com/.../ClientApiWrapper.aspx), <anonymous>:1:1)
at RunHandlerInternal (ssgrp.crm8.dynamics.com/.../ClientApiWrapper.aspx)
at RunHandlers (ssgrp.crm8.dynamics.com/.../ClientApiWrapper.aspx)
at OnScriptTagLoaded (ssgrp.crm8.dynamics.com/.../ClientApiWrapper.aspx)
at https://ssgrp.crm8.dynamics.com/form/ClientApiWrapper.aspx?ver=-269532236:202:1
Javascript Code:
function SetMultiSelValues(executionContext)
{
debugger;
var formContext = executionContext.getFormContext();
var selectedValues = formContext.getAttribute("new_flagreason").getSelectedOption();
var selectedOptionText = formContext.getAttribute("new_flagreason").getText();
if(selectedValues != null){
if(selectedValues != 100000000){
formContext.getAttribute("new_flagstatus").SetValue("100000000");
}
else{
formContext.getAttribute("new_flagstatus").SetValue("100000001");
}
}
}
*This post is locked for comments