Hi Vijay,
My requirement is to get optionset text depending on the optionset value that I retrieve from odata query.
I am using SDK.Metadata.RetrieveAttribute for it.
and I am getting an error 'result' is undefined, while retrieve attribute information from meta data.
Below is the image of my entity logical name in red marking.
![]()
And below image for attribute logical name.
![]()
My code:
function getOptionsetText(){
debugger;
if(typeof SDK.Metadata !="undefined"){
SDK.Metadata.RetrieveAttribute("new_campaignmaster", "new_campaigntype", "00000000-0000-0000-0000-000000000000", true, function (result) {
for (var i = 0; i < result.OptionSet.Options.length; i++) {
var text = result.OptionSet.Options[i].Label.LocalizedLabels[0].Label;
var value = result.OptionSet.Options[i].Value;
}
},
function (error) {
alert("error");
}
);
}
}
I even tried with out of box entity and attribute as below
SDK.Metadata.RetrieveAttribute("incident", "caseorigincode", "00000000-0000-0000-0000-000000000000", true, function (result) {} )
all I'm getting is result is undefined. Can you please let me know where I'm doing it wrong.