Hi All,
I am using the following code to retrieve all the boolean fields present on the form and if the value = true, I am collecting all the display names and setting the value to multi text field. So far everything seems to work but it says invalid type error upon saving.
function writebooleanfieldlables(executionContext){
debugger;
var attfldlst1 =[];
var outpt;
var formContext = executionContext.getFormContext();
var selectedfieldnames=[];
formContext.data.entity.attributes.forEach(
function(attribute,index){
if(attribute.getAttributeType() =="boolean"){
attfldlst1.push(attribute.getName());
}
}
);
attfldlst1.forEach(
function(attribute,index){
if(formContext.getAttribute(attribute).getValue() == 1){
selectedfieldnames.push(formContext.getControl(attribute).getLabel())
}
}
);
formContext.getAttribute("new_selectedfields").setValue(selectedfieldnames);
}