Dynamics crm 2011 MS CRM 2011副本报价单
我与MS CRM 2011合作4周。我必须把现有的报价复制到新的报价上。 哪种方法是最好的方法?使用Javascript还是C#aspx主页 能给我举个例子吗 提前感谢Dynamics crm 2011 MS CRM 2011副本报价单,dynamics-crm-2011,Dynamics Crm 2011,我与MS CRM 2011合作4周。我必须把现有的报价复制到新的报价上。 哪种方法是最好的方法?使用Javascript还是C#aspx主页 能给我举个例子吗 提前感谢 托马斯有很多方法可以做到这一点。这里有两个 URL初始化 我以前为联系人实施过此功能。我的需求最适合URL初始化方法。我也可以看到这种技术在引用方面的优势。对于这种方法,我也建议描述如何进行 我使用了Gareth文章中的几个元素,但我将我的结束脚本分解成了更紧凑的内容。本质上,您可以使用javascript来提取特定字段的
托马斯有很多方法可以做到这一点。这里有两个 URL初始化 我以前为联系人实施过此功能。我的需求最适合URL初始化方法。我也可以看到这种技术在引用方面的优势。对于这种方法,我也建议描述如何进行 我使用了Gareth文章中的几个元素,但我将我的结束脚本分解成了更紧凑的内容。本质上,您可以使用javascript来提取特定字段的值,并将它们作为查询字符串参数排列到一个特殊格式的CRM表单URL中。此url解压查询字符串参数,并将传递的值以新形式分配给相应字段。如果您打开了一个项目,并且希望克隆该项目,并将新表单保留为打开状态供用户编辑,则此操作非常有效 我最终从联系人表单功能区调用了这个脚本,它作为web资源添加。Gareth也很好地解释了如何做到这一点
// Register this namespace to avoid collision with other scripts that may
// run within this form
Type.registerNamespace("BF.Contact");
// Create a function that will be called by a ribbon button.
BF.Contact.Clone = function() {
var extRaqs = "";
// ownerid
extRaqs += "&ownerid=" + Xrm.Page.getAttribute("ownerid").getValue()[0].id;
extRaqs += "&owneridname=" + Xrm.Page.getAttribute("ownerid").getValue()[0].name;
extRaqs += "&owneridtype=systemuser";
extRaqs += BF.Contact.Clone.GetValue("address1_line1");
extRaqs += BF.Contact.Clone.GetValue("address1_line2");
extRaqs += BF.Contact.Clone.GetValue("address1_city");
extRaqs += BF.Contact.Clone.GetValue("address1_postalcode");
extRaqs += BF.Contact.Clone.GetValue("mobilephone");
extRaqs += BF.Contact.Clone.GetValue("telephone1");
extRaqs += BF.Contact.Clone.GetValue("telephone2");
extRaqs += BF.Contact.Clone.GetValue("fax");
extRaqs += BF.Contact.Clone.GetValue("emailaddress1");
extRaqs += BF.Contact.Clone.GetValue("address1_county");
extRaqs += "&donotsendmm=1"
var newURL = Xrm.Page.context.getServerUrl() + "/main.aspx?etn=contact&pagetype=entityrecord&extraqs=";
newURL += encodeURIComponent(extRaqs);
window.open(newURL , "_blank", "width=900px,height=600px,resizable=1");
}
BF.Contact.Clone.GetValue = function(attributename) {
var _att = Xrm.Page.getAttribute(attributename);
var _val = "";
if (_att == null || _att.getValue() == null ) {
return "";
}
if (_att.getFormat() == "date") {
_val = _att.getValue().format("MM/dd/yyyy");
} else {
_val = _att.getValue();
}
return "&" + attributename + "=" + _val;
}
一些缺点: