I need to get an optionset label in client side js (you can watch the code below), the problem is that the code recognize the Sdk object but not the Metadata option and the code crushes, how can I get the optionset label in client side? or why Metadata is not optional to use? Am I missing a lib?
Option A Sdk.Metadata.RetrieveAttribute(EntityLogicalName, AttributeLogicalName, null, false, function (result) { for (var i = 0; i < result.OptionSet.Options.length; i++) { languageArray[result.OptionSet.Options[i].Value] = result.OptionSet.Options[i].Label.LocalizedLabels[0].Label; } }, function (error) { alert("error"); } ); Option b //Sdk.Metadata.RetrieveAttribute(EntityLogicalName, AttributeLogicalName, "00000000-0000-0000-0000-000000000000", false, // function (result) { // for (var i = 0; i < result.OptionSet.Options.length; i++) { // var loopText = result.OptionSet.Options[i].Label.LocalizedLabels[0].Label; // var loopValue = result.OptionSet.Options[i].Value; //-- I want to do a check here but this is in a different function // } // }, //function (error) { } //);