locked
How to I find the Contact icon when defaulting a partylist lookup to a Contact's view? [CRM 2011] [Jscript] RRS feed

  • Question

  • Per this post ( http://social.microsoft.com/Forums/en-US/b5c553b8-a90b-47f7-9191-4d825ecb9280/change-default-view-for-partylist-type-field ), I'm trying to set the default view of the Sender or Recipient lookups (depending on the Direction of the Phone Call) to Contacts. Outgoing calls are Phase 2 so I know I'll need to be able to set this to Users as well but I'm not going to worry about that for now.

    Anyway, the snippet here works but the icon is for Accounts, not Contacts. Where can I find how to get the icon I need?

    ///////////////////////////////////////////////////////////////////////////////////////////////// function ToggleLookupViewtoContacts(){ var Direction = Xrm.Page.getAttribute('directioncode'); var Sender = Xrm.Page.getAttribute('from'); var Sender_field = Xrm.Page.getControl('from'); var Sender_style = document.getElementById('from'); /*var Recipient = Xrm.Page.getAttribute('to'); var Recipient_field = Xrm.Page.getControl('to'); var Recipient_style = document.getElementById('to'); */ if (Direction.getValue() == 0){ Sender_style.setAttribute('lookuptypes', '2'); Sender_style.setAttribute('lookuptypeicons', '/_imgs/ico_16_2.gif,/CRM2011/WebResources/xrm_icolist16,/CRM2011/WebResources/xrm_icocom16');

    //^This isn't right apparently. Get a big old ugly red X. Sender_style.setAttribute('defaulttype', '2'); //Sender_field.setDefaultView('00000000-0000-0000-00AA-000010001003'); //From the linked post above. Defaults to the My Contacts view which I don't want. Sender_field.setDefaultView('A2D479C5-53E3-4C69-ADDD-802327E67A0D'); //The Contact lookup view for my Org }

    }




    • Edited by M. Jaxon Saturday, August 17, 2013 7:28 PM snippet tweak
    • Moved by Donna EdwardsMVP Friday, August 30, 2013 9:39 AM
    Saturday, August 17, 2013 7:23 PM