5.       现在我们来看一个普遍应用的例子:我只想在regardingobjectidLookup里列出OpenCase

 

a.       CRM 3.0

 

 

}


 

b.      CRM 4.0

 

4.0里,上述功能(additionalparams)不再可以使用,但是我们仍然可以使用上一篇文章提到的技术:打开Case Lookup View, 点击'添加新的搜索栏'( Add Find Column),  选择statecode,保存并发布。然后在Form.onLoad()里面输入如下代码:

 

;

 

大家已经看到了,像这种简单的Filter功能用这个技术就可以实现。但是如果想实现复杂一点的呢?
比如我们现在的要求变成了:只列出当前用户的
Open Case!


像这样复杂一些的
Filter功能我们一般先用高级查找(Advanced Find)Build FetchXml,然后再进行下一步。具体做法在Ronald Lemmen Blog里有讲:就是在搜索结果的IE地址栏里输入如下代码:javascript:prompt("", resultRender.FetchXml.value);


这样会弹出一个
JavaScript.pormpt窗口,具体到我们的这个例子弹出的FetchXml语句是:


<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"><entity name="incident"><attribute name="title"/><attribute name="ticketnumber"/><attribute name="createdon"/><attribute name="incidentid"/><order attribute="title" descending="false"/><filter type="and"><condition attribute="statecode" operator="eq" value="0"/><condition attribute="ownerid" operator="eq-userid"/></filter></entity></fetch>


下面介绍的在
CRM 4.0里面的FilteredView功能最先是Adi Katz开发的,然后网友George进行了一些改进。我拿改进好的版本给大家演示:(注:下面的定制方法属于非常Unsupported的那种Customizationidea是重载了code-behind 的程序,加一个Filter进去。CRM 4.0 目前只有一种基于Filtered Lookup Supported Customization,是Michael Höhne开发的收费插件


你需要修改这个文件:
CRMWeb\\_controls\\lookup\\lookupsingle.aspx,加入下面的代码:


神秘的 CRM Lookup (III)<script runat="server">
神秘的 CRM Lookup (III)
protected override void OnLoad(EventArgs e)
>



然后在Form.onLoad()里面写入下面的代码(和 CRM3.0相似),注意fetchStr的值就是我们在高级搜索里得到的值:


 fetchStr;



到目前为止,这个方法已经应用了3个月,没有什么状况。所以介绍给大家 :)



相关文章:

  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2021-07-21
  • 2021-08-02
  • 2021-06-18
  • 2021-07-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
相关资源
相似解决方案