crm - Javascript - Set Required level doesn't work - Stack Overflow

I use JavaScript to set required level of field based on some selections, the field appears as optional

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
Add a ment  | 

1 Answer 1

Reset to default 6

The 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

相关推荐

  • crm - Javascript - Set Required level doesn't work - Stack Overflow

    I use JavaScript to set required level of field based on some selections, the field appears as optional

    1小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信