I use JavaScript to set required level of field based on some selections, the field appears as optional but the form doesn't able to save and says please fill this field.
My code
Xrm.Page.ui.controls.get("new_field").setRequiredLevel("none");
I don't know why this happen i tried to hide the field using this code
Xrm.Page.ui.controls.get("new_field").setVisible(false);
it hides the field but when i press save the field appears again like a charm and cannot save the form.
I use JavaScript to set required level of field based on some selections, the field appears as optional but the form doesn't able to save and says please fill this field.
My code
Xrm.Page.ui.controls.get("new_field").setRequiredLevel("none");
I don't know why this happen i tried to hide the field using this code
Xrm.Page.ui.controls.get("new_field").setVisible(false);
it hides the field but when i press save the field appears again like a charm and cannot save the form.
Share Improve this question asked Sep 20, 2015 at 20:33 Hussein FawzyHussein Fawzy 5351 gold badge8 silver badges15 bronze badges 3- Which entity and field? – James Wood Commented Sep 20, 2015 at 20:51
- Case entity and the field is lookup i created – Hussein Fawzy Commented Sep 21, 2015 at 5:14
- 1 To clarify, getControl = form actions (Disable, Visible...) getAttribute = value actions (get, set, required level...) – Sxntk Commented Sep 21, 2015 at 18:21
1 Answer
Reset to default 6The script doesnt look quite right,
setRequiredLevel
Xrm.Page.getAttribute("new_field").setRequiredLevel("none");
Visible
Xrm.Page.getControl("new_field").setVisible(false);
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745123333a4612544.html
评论列表(0条)