随笔分类 -  Js

Js
摘要:1 // 获取地址栏的参数数组 2 function getUrlParams() { 3 var search = window.location.search; 4 // 写入数据字典 5 var tmparray = search.substr(1, search.l... 阅读全文
posted @ 2014-03-25 15:47 Bill 李 阅读(180) 评论(0) 推荐(0)
摘要:crm 2011 获取当前实体idXrm.Page.data.entity.getId();crm 2011 获取当前实体名称Xrm.Page.data.entity.getEntityName()crm 2011 获取父实体id (前提是新窗口打开): window.parent.opener.X... 阅读全文
posted @ 2014-01-16 16:33 Bill 李 阅读(251) 评论(1) 推荐(0)
摘要:日期格式化var myDate = new Date();var myDate1 = new Date();myDate1.setMonth(0);myDate1.setDate(-1);var rq = myDate -myDate1 ;var s1 = Math.ceil(rq/(24*60*60*1000));var s2 = Math.ceil(s1/7);var nowDayOfWeek = myDate.getDay()-1; //今天本周的第几天 (由于是显示周一开始,而不是周日开始)var nowDay = myDate.getDate(); //当前日 var nowMont 阅读全文
posted @ 2014-01-16 16:31 Bill 李 阅读(512) 评论(0) 推荐(0)
摘要:选择器过滤(选择客户后联动项目)function AddCustomerView() { var viewId = "{229782D0-1101-48E1-B414-ECB181F97C52}";var entityname="xz_project";var viewDisplayname="项目... 阅读全文
posted @ 2014-01-16 16:24 Bill 李 阅读(362) 评论(0) 推荐(0)
摘要:根据选择类型隐藏或显示tab.function association(){ var attribute= Xrm.Page.getAttribute("xd_type"); var value= attribute.getValue(); if(value==0){ hidetab("tab_5"... 阅读全文
posted @ 2014-01-16 16:22 Bill 李 阅读(241) 评论(0) 推荐(0)
摘要:选择lookup后自动带出其中的某个字段大小(注意 此字段必须在视图中有显示)//获取size 值function getField(){ var field =Xrm.Page.getAttribute("field");//lookup字段 var fieldSize; if(field==null){ return 0 ; }else{ var fieldValue=field.getValue(); if(fieldValue !=null){ fieldSize = fieldValue[0].keyValues.size.value;//lookup里面的大小字 阅读全文
posted @ 2014-01-16 16:18 Bill 李 阅读(432) 评论(0) 推荐(0)
摘要:1 获取文本中的值 2 3 var name=Xrm.Page.getAttribute("xd_name").getValue(); 4 5 获取lookup选择的文本 6 7 var company=Xrm.Page.getAttribute("xd_company").getValue(); 8 9 var name=company[0].name10 11 12 给字段赋值13 Xrm.Page.getAttribute("xd_name").setValue(name);14 15 获取下拉框的文本/值16 var name 阅读全文
posted @ 2014-01-16 16:16 Bill 李 阅读(302) 评论(0) 推荐(0)
摘要:js验证邮箱 var temp = document.getElementById("email"); //对电子邮件的验证 var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/; if (!myreg.test(temp.value)) { $("#intererrmsg").show(); $("#intermsg").html("请输入正确的用户名!" 阅读全文
posted @ 2014-01-16 16:06 Bill 李 阅读(4032) 评论(0) 推荐(0)
摘要:获取当前页面完整地址:var url = window.top.document.URL;获取当前页面名称:var pagename=window.location.pathname 阅读全文
posted @ 2014-01-16 15:59 Bill 李 阅读(1668) 评论(0) 推荐(0)
摘要:var arrCookie = document.cookie;var arr = arrCookie.split("=");var kcode = arr[1].toUpperCase(); 阅读全文
posted @ 2014-01-16 15:53 Bill 李 阅读(178) 评论(0) 推荐(0)
摘要:1.Xrm.Page.context 用户ID:getUserId() 用户角色:getUserRoles() 用户语言:getUserLcid() 组织名称:getOrgUniqueName() 组织语言:getOrgLcid() 路径参数:getQueryStringParameters()2.Xrm.Page.data.entity 所有页面元素:attributes【forEach(),get(),getLength()】 单个元素:attributes.get("")【同Xrm.Page.getAttribute()】 实体名称:getEntityName() 实 阅读全文
posted @ 2013-10-25 14:10 Bill 李 阅读(220) 评论(0) 推荐(0)