locked
CRM 2013 Javascript set lookup value problem.why? RRS feed

  • Question

  • Hello experts,

    I am using crm 2013 orion server .in that i am using one javascript for xrm.page  to set lookup value .i am using as crm 2011 

    but the lookupvalue is not populated to corresponding field.it was working in polarisversion .but what are changes in xrm model ,I got no error in my script.but what might be the reason for not lookupvalue is not set.

    thanks and regards

    Murali

    Wednesday, September 25, 2013 6:11 AM

All replies

  • Can you post a code snippet?

    Perhaps the ID you are setting is not valid?

    I've tested this using the following code, which works fine (it is simply setting the parent account lookup on an account to another account:

    Xrm.Page.getAttribute("parentaccountid").setValue([{ id: "2FF3F441-AA25-E311-AF1B-00155D048D05", name: "Test", entityType: "account"}]);

    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism

    Wednesday, September 25, 2013 6:26 AM
  • hi,i am uisng below code for setlookup value in crm 2013 orion ,the lookup is not populating please suggest what might be the wrong .

    function setlook()
    {
    debugger;
      Xrm.Page.getAttribute("defaultpricelevelid").setValue([{ id:"1ba80ccf-2112-e311-9412-0800272b6ae0", name:"18-30 Year Price
    List" , entityType: "contact"}]);
    }

    thanks and regards

    murali

    Friday, September 27, 2013 8:46 AM
  • hi,i am uisng below code for setlookup value in crm 2013 orion ,the lookup is not populating please suggest what might be the wrong .

    function setlook()
    {
    debugger;
      Xrm.Page.getAttribute("defaultpricelevelid").setValue([{ id:"1ba80ccf-2112-e311-9412-0800272b6ae0", name:"18-30 Year Price
    List" , entityType: "contact"}]);
    }

    thanks and regards

    murali

    You are setting a price list lookup, so your entityType needs to be pricelevel, change the code to:

    function setlook()
    {
    debugger;
      Xrm.Page.getAttribute("defaultpricelevelid").setValue([{ id:"1ba80ccf-2112-e311-9412-0800272b6ae0", name:"18-30 Year Price List" , entityType: "pricelevel"}]);
    }


    My blog: www.crmanswers.net

    Friday, September 27, 2013 9:55 AM
  • You may also want to enclose the id in parentheses {1ba80ccf-2112-e311-9412-0800272b6ae0

    HTH

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Friday, September 27, 2013 12:08 PM