CRM JS Set lookup field Setsimplelookupvalue

Source: Internet
Author: User

functionSetsimplelookupvalue (LookupId, Type, Id, Name) {///<summary>    ///sets the value for lookup attributes this accept only a single entity reference.    ///Use of the This function to set lookups. Allow for multiple references,    ///a.k.a ' partylist ' lookups, would 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 is displayed in the lookup.    ///</param>    ///setsimplelookupvalue ("Primarycontactid", "contact", "{6d9d4fcf-f4d3-e011-9d26-00155dba3819}", "Brian LaMee");    varLookupreference = []; 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");}

CRM JS Set lookup field Setsimplelookupvalue

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.