首页 > Web开发 > 详细

dynamics crm 一些常用的js

时间:2018-12-11 01:08:15      阅读:208      评论:0      收藏:0      [点我收藏+]

整理下平时CRM开发中用到的一些基本的js操作

取值:

var oResult = Xrm.Page.getAttribute(sFieldNames).getValue();

var oResult = Xrm.Page.getControl(sFieldNames).getAttribute().getValue();

赋值:

Xrm.Page.getAttribute(sFieldName).setValue(object);

OptionSet: Xrm.Page.getAttribute(sFieldName).setValue(1);  //OptionSet的对应选项的Value

Lookup: Xrm.Page.getAttribute(sFieldName).setValue([{ id:"record id", name: "sValue", entityType: "Entity Name" }]);

 

提示指定错误:

Xrm.Page.getControl(sFieldName).setNotification(sErrorMessage);

清除错误提示:

Xrm.Page.getControl(sFieldName).clearNotification();

 

设置Read Only:

Xrm.Page.getControl(sFieldName).setDisabled(true);

设置Enable:

Xrm.Page.getControl(sFieldName).setDisabled(false);

 

设置必填:

Xrm.Page.getAttribute(sFieldName).setRequiredLevel("required");

设置可选:

Xrm.Page.getAttribute(sFieldName).setRequiredLevel("none");

 

添加事件:

Xrm.Page.getControl(sFieldName).getAttribute().addOnChange(fnOnChange);

 

dynamics crm 一些常用的js

原文:https://www.cnblogs.com/Sunny20181123/p/10100112.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!