The specific code was using the getText function in order to retrieve the label of an optionset field. The getText function used to return an empty string in Dynamics instances prior to CRM 2016, but in recent versions it returns null. If you need to handle the label in your code (like showing some alerts) the check should be like this one:
function checkOptionsetLabel(context, fieldName) { var selectedLabel = context.getAttribute(fieldName).getText(); if (selectedLabel != null) { // ... } }Also the official documentation has been updated to highlight the return value. Hope it helps!
0 comments:
Post a Comment