zoukankan      html  css  js  c++  java
  • CRM JS 设置lookup字段 setSimpleLookupValue

    function setSimpleLookupValue(LookupId, Type, Id, Name) {
        /// <summary>
        /// Sets the value for lookup attributes that accept only a single entity reference.
        /// Use of this function to set lookups that allow for multiple references, 
        /// a.k.a 'partylist' lookups, will remove any other existing references and 
        /// replace it with just the single reference specified.
        /// </summary>
        /// <param name="LookupId" type="String" mayBeNull="false" optional="false" >
        /// The lookup attribute logical name
        /// </param>
        /// <param name="Type" type="String" mayBeNull="false" optional="false" >
        /// The logical name of the entity being set.
        /// </param>
        /// <param name="Id" type="String" mayBeNull="false" optional="false" >
        /// A string representation of the GUID value for the record being set.
        /// The expected format is "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}".
        /// </param>
        /// <param name="Name" type="String" mayBeNull="false" optional="false" >
        /// The text to be displayed in the lookup.
        /// </param>
        ///setSimpleLookupValue("primarycontactid", "contact", "{6D9D4FCF-F4D3-E011-9D26-00155DBA3819}", "Brian Lamee");
    
    
        var lookupReference = [];
        lookupReference[0] = {};
        lookupReference[0].id = Id;
        lookupReference[0].entityType = Type;
        lookupReference[0].name = Name;
        Xrm.Page.getAttribute(LookupId).setValue(lookupReference);
        Xrm.Page.getAttribute(LookupId).setSubmitMode("always");
    }
  • 相关阅读:
    理想解法
    IEEExtreme 2021
    day_1-python前期学习准备篇
    电梯模拟C++
    java线程_01——————————HelloWorld例子
    Unknown tag (c:forEach) 未知的标签
    自动生成Junit单元测试的插件 CodeProAnalytix
    Log4j笔记----01
    Springboot学习笔记_helloWorld篇
    支持开源,崇尚技术,追求真理,充实人生
  • 原文地址:https://www.cnblogs.com/BinBinGo/p/6129564.html
Copyright © 2011-2022 走看看