Notifications
Announcements
No record found.
Hi Guys,
I'm having 10 options set in a form. I want to retrieve the options set schema name by javascript.
Is it possible? if it so, please tell me how to do it.
*This post is locked for comments
Hi Sravanakumar,
Hope below lines will help you.
Xrm.Page.data.entity.attributes.forEach(function (attribute, index) {
var control = attribute.controls.get(0);
// Cheking if Control is an optionset and it is not hidden
if(control.getControlType() == "optionset" && control.getVisible() == true) {
var schemaName= control.getLabel();
}
});
Please mark this as answered if it solved your problem.
Yes it possible to retrieve schema name of the attributes.
Refer below example from microsoft that how to retrieve metadata of entity
msdn.microsoft.com/.../gg594428.aspx
Hi Jitendra Sahu,
Thanks for the code, But this code gives the result only when the no option are selected in it. When i select options from the optionset and then i run the code, it gave me the selected options.
But i got a hint from your post.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2