Setting a value to the lookup in ms crm 2011 RRS feed

  • Question

  • How to set a particular record to the Lookup field in ms crm 2011
    Friday, September 16, 2011 12:01 PM


All replies

  • Are you talking about JScript or .Net?


    if JScript:

    var olookup = new Object();
    olookup.id = "tne id";
    olookup.entityType = "entityName";
    olookup.name = "the name";
    var olookupValue = new Array();
    olookupValue[0] = olookup;
    Xrm.Page.getAttribute("the attribute logical name").setValue(olookupValue);

    if .Net

    entity["lookupLogicalName"] = new EntityReference("entityName", (Guid)theId);

    My blog : http://mscrmtools.blogspot.com

    All my tools for Dynamics CRM 4.0 on my dedicated site: MSCRMTools Repository

    Friday, September 16, 2011 12:17 PM
  • I believe this question refers to administration task. If it is YES, then any of the field which contains lookup field is recognized by the MSCRM as you have already updated that particular section with respective data. If not, it would ask you to ADD a new record either through file menu or at the bottom left side. This way you can set a record in that field or else if you enter anything without adding prior to that section, then CRM will be searching for that string you have entered in that box.

    Hope this helps you.

    Friday, September 16, 2011 11:49 PM
  • If I just have the guid for the lookup value, how do I preselect that in the list?




    Wednesday, December 21, 2011 2:58 PM