locked
How to copy value from lookupfield RRS feed

  • Question

  • Hi All;

    How to copy lookup value from one foeld to another in CRM 4.0?

    Any help much appreciated

    Thanks

    Pradnya


    Pradnya07

    Wednesday, July 3, 2013 11:54 AM

All replies

  • var lookupObject = new Object;
    var lookupObjectArray = new Array();
    lookupObject.id = "21EC2020-3AEA-1069-A2DD-08002B30309D"// Put the id of source lookup field like crmForm.all.new_FEILDNAME.DataValue[0].id;
    lookupObject.name = "John Doe";//Put the name of source lookup field like crmForm.all.new_FEILDNAME.DataValue[0].name ; 

    lookupObject.typename = "systemuser";//Put entity name of source lookup like "contact";

    lookupObjectArray[0] = lookupObject;

    crmForm.all.new_DESTINATIONFIELDNAME.DataValue = lookupObjectArray;

    crmForm.all.new_DESTINATIONFIELDNAME.ForceSubmit = true;

    if you want to put in a text field than

    crmForm.all.new_DESTINATIONFIELDNAME.DataValue = crmForm.all.new_LOOKUPFIELDNAME.DataValue[0].name ; //to putlate the name of lookup


    Regards Faisal

    • Proposed as answer by Faisal Fiaz Wednesday, July 3, 2013 12:30 PM
    Wednesday, July 3, 2013 12:20 PM