随笔分类 - CRM 2011
摘要:这个例子实现的是商机的商机阶段(statuscode)字段值如果是量产,整行记录换个颜色。将要修改的实体,我这里是商机实体,加入一个解决方案,然后导出这个解决方案,解压,然后修改其中的 customizations.xml ,将RibbonDiffXml 这个元素之间的值替换为如下: ...
阅读全文
摘要:protected void loadUnTaskInfo(IOrganizationService server) { string untaskXml = string.Format(@" ...
阅读全文
摘要:注意:用户需要安全角色读的权限,function onLoad() { CurrentUserHasRole('系统管理员'); //有则是TRUE}//功能说明: 获取当前用户是否具有该角色//备注: //参数说明:// roleName: 角色名称//返回值说明(return):// bool:function CurrentUserHasRole(roleName) { //为了避免OData中文检索不出这种问题,使用encodeURIComponent来encode; var serverUrl = Xr...
阅读全文
摘要://最近一周完成的任务 protected void loadCompTaskInfo(IOrganizationService server) { string untaskXml = string.Format(@" ...
阅读全文
摘要:1.在对应实体的HomePage新增按钮土地地图,调用landinfomap.JS(上传到系统WEB资源中)2. New_landdata.JS中关键代码//取经过筛选之后视图的FETCHXML,并保存在实体new_tempdata中(因XML过长,URL传值受到限制,目前只找到此方法),然后把保存的记录ID传参到LandDataMap.aspx页面(需另外做个批量删除的作业,来删除实体new_tempdata不需要的数据,可在数据管理—>> 批量删除记录里面创建)function landinfomap(IDArr) { var fetchxml = IDArr.GetParam
阅读全文
摘要:以contact的parentcustomerid为例,它是一个lookup field。lookup type为account和contact。默认type为account如果要设置默认type为contact的话,可以document.getElementById("parentcustomerid").setAttribute("defaulttype", "2"); // 2 是contact object type code如果lookup type为account和contact,可以document.getElement
阅读全文
摘要:一.通过URL打开报表action设置为run或者filter,设置为run是使用报表默认条件运行报表,指定为filter时就会打开报表的筛选器,指定筛选条件后点击 运行报表 就可以运行报表了。helpID可选参数,可也设置为报表的FielName属性的值,还有就是标准报表使用该值可以打开让用户打开相应的帮助id报表的ReportId属性的值Jscript示例:function getReportURL(action, fileName, id) { var orgUrl = GetGlobalContext().getClientUrl(); var reportUrl = orgUrl +
阅读全文
摘要:Xrm.Page.ui.navigation.items 获取左边导航栏的集合getId 获取导航项的名称var navItemIds = [];Xrm.Page.ui.navigation.items.forEach( function (item, index) { navItemIds.push(item.getId()) });getLabel 获取导航项的显示文本var navAddressesLabel = Xrm.Page.ui.navigation.items.get("navAddresses").getLabel();setLabel 设置导航项的显示文
阅读全文
摘要:1.设置控件只读Xrm.Page.ui.controls.get("new_forecasttype").setDisabled(true);Xrm.Page.controls.("new_forecasttype").setDisabled(true);--选项卡是否可见Xrm.Page.ui.tabs.get("tab_3").setVisible(false);--选项卡下的节点是否可见Xrm.Page.ui.tabs.get("tab_5").sections.get("tab_5_section
阅读全文
摘要://检查是否打开父窗口或不是if (window.parent.opener.Xrm.Page){ return true;}else { return false;}
阅读全文
摘要://隐藏左侧工作流菜单if(window.document.getElementById( 'navAsyncOperations')!=null){ window.document.getElementById( 'navAsyncOperations').style.display = 'none'; };
阅读全文
摘要://子网格刷新父页面parent.opener.parent.document.location.reload();
阅读全文
摘要://crm中的iframe传递参数到aspx页var newTarget = "http://www.cnblogs.com/../ktfw/NewOrOld.aspx";var nsrsbh =crmForm.all.new_nsrsbh.DataValue;newTarget = newTarget +"?nsrsbh="+nsrsbh;crmForm.all.IFRAME_nsrxx.src =newTarget ;
阅读全文
摘要://检查是否打开父窗口或不是if (window.parent.opener.Xrm.Page){ return true;}else { return false;}
阅读全文
摘要://CRM中URL编码和解码alert(CrmEncodeDecode.CrmNameValueEncode("Good Morning!")); alert(CrmEncodeDecode.CrmNameValueDecode("%3fetc%3d10018"));//js 编码Server.UrlEncode
阅读全文
摘要:(1).function ChangeDateFormat(val) { var date = new Date(parseInt(val.replace("/Date(", "").replace(")/", ""), 10)); var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1; var currentDate = date.getDate() < 10
阅读全文
摘要:1,查询时间类型的时候 时间取值要用UTC时间,转成待定格式的字符串例如:$filter=new_date ge datetime'2010-09-10T12:00:00' and new_date le datetime'2010-09-12T12:00:00' and new_type/Value ne 100000000时间转换函数如下 :function GetUTCDate(date) { var year = date.getUTCFullYear(); var month = date.getUTCMonth() + 1; if (month &l
阅读全文
摘要:CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration" /out:Xrm.cs /url:http://crm/Test/XRMServices/2011/Organization.svc /domain:*** /username:*** /password:***** /namespace:Xrm /serviceContextName:XrmServiceContext
阅读全文
摘要:1.一自定义页面通过ifram签入到客户页面中,取客户页面中的字段new_nameparent.window.document.getElementById("new_name").valueparent.Xrm.Page.getAttribute("字段ID");2.crm中的iframe传递参数到aspx页var newTarget = "http://www.cnblogs.com/../ktfw/NewOrOld.aspx";var nsrsbh =crmForm.all.new_nsrsbh.DataValue;newTar
阅读全文
摘要:1.增加按钮,调用JS(),2.JS代码Ceshi =function(gridControl, entityTypeCode) { var id =gridControl.get_selectedIds();}
阅读全文