• Dynamics CRM


    一、如何指定 Partylist 类型字段能 lookup 的实体(以 Appointment 中某个字段为例子):

          代码如下:

    var control = Xrm.Page.getControl("requiredattendees");
    control.getAttribute().setLookupTypes(["systemuser", "contact"]);

          执行前:

     

          执行后:

     

    二、使用 JavaScript 对 sub-grid 进行过滤,具体过程如下:

          1.首先打开 CRM 系统的 Advanced Find:

          2.选择 Sub grid 对应的 Entity(以 Appointment 为例子),并添加所需要的筛选条件,点击下载 Fetch XML:

          3.下载后得到的文本内容如下(有所省略,只是一个sample):

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
      <entity name="appointment">
        <attribute name="..." />
        <attribute name="..." />
        ...
        <attribute name="..." />
        <order attribute="..." descending="true" />
        <filter type="and">
          <condition attribute="actualend" operator="on-or-after" value="2019-04-16" />
        </filter>
      </entity>
    </fetch>

          4.在 JavaScript 中调用 XML 对 Sub grid 进行过滤:

    var sSubGridName = "..." //Sub grid的名字
    var caseXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" + 
    "<entity name='appointment'>" + 
    "<attribute name='...' />" + 
    "..." + 
    "<attribute name='...' />" +
    "<order attribute='...' descending='true' />" + 
    "<filter type='and'>" +
    "<condition attribute='actualend' operator='on-or-after' value='2019-04-16' />" +
    "</filter>" +
    "</entity>" +
    "</fetch>";
    var SubGridDetails = window.parent.document.getElementById(sSubGridName);
    if (SubGridDetails != null) {
        if (SubGridDetails.control != null) {
            SubGridDetails.control.SetParameter("fetchXml", caseXml); //set the fetch xml to the sub grid   
            SubGridDetails.control.refresh(); //refresh the sub grid using the new fetch xml
        }
    }
  • 相关阅读:
    FCKEditor使用说明
    如何查看索引或table所佔用的實際空間
    java字节输入流
    文件的读写操作
    利用JProfiler
    javascript面向对象技术基础(五)
    深刻理解Linux进程间通信(IPC)
    JAVA中操作数据库方式与设计模式的应用 2
    javascript面向对象技术基础(六)
    FCKeditor在线编辑器
  • 原文地址:https://www.cnblogs.com/Sunny20181123/p/10718044.html
Copyright © 2020-2023  润新知