How to set a lookup value using Xrm.utility for an existing record. RRS feed

  • Question

  • Hi all,

    i am having a problem in setting the lookup field value by using XRM.Utility.

    I am unable to set the lookup of an existing record.

    How to do it.

    here is my code:

    var parameters = {
                mcg_clientid: clientId,
                mcg_clientidname: clientname

            Xrm.Utility.openEntityForm("new_entity",recordId , parameters);

    here recordId is already existing record id.

    Monday, January 20, 2014 2:28 PM

All replies

  • Hi,

    You can only set values on new records (where recordId is null) - this method won't work for existing records. You will need to make a SOAP/REST call to update the record and then open the record.

    Taken from http://msdn.microsoft.com/en-us/library/gg334436.aspx

    "You use these parameters to set default values when you create a new record in the application"

    Hope this helps,


    Scott Durow
    Blog www.develop1.net    Follow Me
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Monday, January 20, 2014 2:45 PM