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
}
}