Hi, my situation is that I have a field twice on the same form and I need to get one of them, I thought about getting the section and then the tab and the attribute, how can I do that?
Hi, my situation is that I have a field twice on the same form and I need to get one of them, I thought about getting the section and then the tab and the attribute, how can I do that?
This works:
formContext.ui.tabs.get(3).sections.get(0).controls.get(0).getAttribute("msdyn_instructions").setRequiredLevel("required")
Control doesn't have requirement level possibility. Attribute has. Try following:
Xrm.Page.getAttribute("colour").setRequiredLevel("required");
it works great but now I have a new prob I need to set this control/attr as required and I fet errors:
if(Xrm.Page.ui.tabs.get("tab1").sections.get("section").controls.get("colour").getVisible()) - works
{
Xrm.Page.ui.tabs.get("tab1").sections.get("section").controls.get("colour").setRequiredLevel("required"); - doesn't work - error
Xrm.Page.ui.tabs.get("tab1").sections.get("section").controls.get("colour").getAttribute("colour").setRequiredLevel("required");- doesn't work - error
}
How do i do that?
Attribute doesn't have visibility. Attribute is all about the data.
Control is about visible/hidden.
Try following:
Xrm.Page.ui.tabs.get("tab").sections.get("Vehicle").controls.get("colour")
or
Xrm.Page.ui.tabs.get("tab").sections.get("Vehicle").controls.get("colour1")
because indexing is used when there are multiple controls for the same field - docs.microsoft.com/.../controls-collection
I tried this :
Xrm.Page.ui.tabs.get("tab").sections.get("Vehicle").getAttribute("colour")
I need to check if one of the "fields" is visiable
Hello,
Attribute is the same but it has 2 controls. What's your scenario?
André Arnaud de Cal...
292,516
Super User 2025 Season 1
Martin Dráb
231,430
Most Valuable Professional
nmaenpaa
101,156