1

我想隐藏Field Service - Dynamics 365应用程序上的Optionset值。我们正在使用Woodford解决方案进行定制。基于Resco Javascript Bridge Reference,我没有看到隐藏现有选项集中选项的方法。所以我创建了一个ComboBox并试图将选项添加到ComboBox中。但即使我在ComboBox上添加了错误的标签,也添加了多个选项,但它仅显示一个选项。隐藏Resco Mobile CRM中的选项

if ((responseTypeOptionSetValues.length == responseTypeOptionSetLables.length) 
     && responseTypeOptionSetLables.length > 0) { 
    for (i = 0; i < responseTypeOptionSetValues.length; i++) { 
     if (valueListOptions.length > 0) { 
      for (i = 0; i < responseTypeOptionSetValues.length; i++) { 
       if (valueListOptions.indexOf(responseTypeOptionSetValues[i].toString()) != -1) { 
        finalLabelValue = responseTypeOptionSetLables[i].toString(); 
        finalOptionValue = responseTypeOptionSetValues[i].toString(); 
        comboItem.listDataSource = { 
         **finalLabelValue: finalOptionValue,** 
           }; 
       } 
      } 
     } 
    }     
} 

回答

1
var data = new Object(); 

if ((responseTypeOptionSetValues.length == responseTypeOptionSetLables.length) && responseTypeOptionSetLables.length > 0) { 
    for (i = 0; i < responseTypeOptionSetValues.length; i++) { 
     if (valueListOptions.indexOf(responseTypeOptionSetValues[i].toString()) != -1) { 
      finalLabelValue = responseTypeOptionSetLables[i].toString(); 
      finalOptionValue = responseTypeOptionSetValues[i].toString();      
      data[finalLabelValue] = finalOptionValue; 
     } 
    } 
} 
if (!isComboItemExists) { 
    comboItem.listDataSource = data; 
    detailView.insertItem(comboItem, -1); 
} 
else { 
    comboItem.listDataSource = data; 
} 
0

你正在用相同的变量名嵌套你的循环。给每个循环一个独特的变量:i,j,k ...