locked
MS CRM 2011 ONLINE - default lookup issue RRS feed

  • Question

  • I debugged these values from lookup:

    id: 03D34054-8209-E311-89B1-FE5DF65E5123 name: Remember add customer, entityType: account

    How I should enter those values to this correctly if I want to set a default lookup:

    Xrm.Page.getAttribute("attributename").setValue([{ id: recorid, name: recordname, entityType: entityname}]);

    If I use this:

    Xrm.Page.getAttribute('customerid').setValue([{id: 03D34054-8209-E311-89B1-FE5DF65E5123, name: Remember add customer, entityType: account}]);

    I only get an error.

    I am setting up default lookup for order's customer field. The customer's name is Remember add customer.

    Tuesday, August 20, 2013 11:17 AM

Answers

  • Hi,

    Provided your GUID is correct, the following should work. It looks like you were just missing the quote marks.

    Xrm.Page.getAttribute('customerid').setValue([{id: '03D34054-8209-E311-89B1-FE5DF65E5123', name: 'Remember add customer', entityType: 'account'}]);
    If this doesn't work, please post the error you receive.

    • Marked as answer by crm-user-crm Tuesday, August 20, 2013 11:42 AM
    Tuesday, August 20, 2013 11:24 AM

All replies

  • Hi,

    Provided your GUID is correct, the following should work. It looks like you were just missing the quote marks.

    Xrm.Page.getAttribute('customerid').setValue([{id: '03D34054-8209-E311-89B1-FE5DF65E5123', name: 'Remember add customer', entityType: 'account'}]);
    If this doesn't work, please post the error you receive.

    • Marked as answer by crm-user-crm Tuesday, August 20, 2013 11:42 AM
    Tuesday, August 20, 2013 11:24 AM
  • Hi,

    Provided your GUID is correct, the following should work. It looks like you were just missing the quote marks.

    Xrm.Page.getAttribute('customerid').setValue([{id: '03D34054-8209-E311-89B1-FE5DF65E5123', name: 'Remember add customer', entityType: 'account'}]);
    If this doesn't work, please post the error you receive.


    Yes it worked. Thanks!
    Tuesday, August 20, 2013 11:42 AM