making "set regarding" default to "contact" instead of "account"

making "set regarding" default to "contact" instead of "account"

This question is not answered

 Hello everyone

I am looking for a way to make the "set regarding" feature default to "contact" in the OUTLOOK CLIENT.  I read somewhere that if you add the code shown below to the lookupsingle.aspx file on the server it will do just that.  Problem is I am javascript illeterate, and every attempt Ive made to do so has failed.  I am replacing the org name shown with mine, but still no dice.

 

Has anyone tried this and if so can you help me out with editing the file?

 


Add JS code into the window.onload() function, so it should looks like:

function window.onload()
{

if(ORG_UNIQUE_NAME == "MicrosoftCRM" && document.URL.indexOf("class=ActivityRegarding") != -1) // Only change the default type when Org=MicrosoftCRM and the lookup class is ActivityRegarding
{
document.getElementById("selObjects").value = "2"; // set default to 'Contact'
document.getElementById("selObjects").onchange();
}

......
}

 

 

Thanks is advance!

Al

http://www.TriadMetals.com

 

 

All Replies
  • try to this because Index of Contact is 3
    function window.onload()
    {

    if(ORG_UNIQUE_NAME == "MicrosoftCRM" && document.URL.indexOf("class=ActivityRegarding") != -1) // Only change the default type when Org=MicrosoftCRM and the lookup class is ActivityRegarding
    {
    document.getElementById("selObjects").value = "3"; // set default to 'Contact'
    document.getElementById("selObjects").onchange();
    }

    ......
    }
  • I am not sure how to incorporate the code into whats already there, which is shown below.  Everything Ive tried has not caused it to default to contacts, and it makes the lookup dialog hang and I cant close it without ending task

     

    function window.onload()
    {
    crmGrid.OnSelectionChange = handlePropertiesBtn;
    crmGrid.OnBeforeFormLoad = handleDblClick;
    crmGrid.SetParameter("disableDblClick", "0");

    if (IsNull(window.dialogArguments))
    btnRemoveValue.disabled = !_enableRemoveButton;
    else
    btnRemoveValue.disabled = IsNull(window.dialogArguments.items) || (window.dialogArguments.items.length == 0);

    if ( !checkMode( _mode, LookupBrowse ) )
    {
    findValue.focus();
    findValue.NotifyFocus();
    }
    else
    {
    crmGrid.focus();
    }


    handlePropertiesBtn();
    }

    function handlePropertiesBtn()
    {
    butBegin.disabled = btnProperties.disabled = !(crmGrid.InnerGrid.SelectedRecords.length >=1)
    }

    function handleDblClick()
    {
    selectItem();
    event.returnValue = false;
    }

    function removeValue()
    {
    window.returnValue = new LookupItems();
    event.returnValue = false;
    window.close();
    }

  •  I have tried a few variations and figured it out.... Thank you for your help!

    For those of you java script illiterate like I here is the complete window.onload section (be sure to replace the org name with yours):

     




    function window.onload()
    {

      if(ORG_UNIQUE_NAME == "TriadCRMTesting" && document.URL.indexOf("class=ActivityRegarding") != -1) // Only change the default type when Org=MicrosoftCRM and the lookup class is ActivityRegarding
      {
        document.getElementById("selObjects").value = "2"; // set default to 'Contact'
        document.getElementById("selObjects").onchange();
      }

    crmGrid.OnSelectionChange = handlePropertiesBtn;
    crmGrid.OnBeforeFormLoad = handleDblClick;
    crmGrid.SetParameter("disableDblClick", "0");

    if (IsNull(window.dialogArguments))
    btnRemoveValue.disabled = !_enableRemoveButton;
    else
    btnRemoveValue.disabled = IsNull(window.dialogArguments.items) || (window.dialogArguments.items.length == 0);

    if ( !checkMode( _mode, LookupBrowse ) )
    {
    findValue.focus();
    findValue.NotifyFocus();
    }
    else
    {
    crmGrid.focus();
    }


    handlePropertiesBtn();
    }

    function handlePropertiesBtn()
    {
    butBegin.disabled = btnProperties.disabled = !(crmGrid.InnerGrid.SelectedRecords.length >=1)
    }

    function handleDblClick()
    {
    selectItem();
    event.returnValue = false;
    }

    function removeValue()
    {
    window.returnValue = new LookupItems();
    event.returnValue = false;
    window.close();
    }