locked
How to show only won opportunities in a lookup RRS feed

  • Question

  • I'm looking for the jscript that will only show me won opportunities in a lookup field. I have the script that shows me all opportunities (open/won/lost) just looking for the variable at the end that will only show 'won' deals.

    currently using crmForm.all.new_changereqestopportunityid.lookupclass = "alllookups"; and I'm assuming there's a key instead of 'alllookups' that will do this.

    Wednesday, September 5, 2012 5:05 PM

Answers

  • Hi Sleahy,

    Write this JScript Code in the Opportunity Lookup Field:

    function view()
    {
    document.getElementById("Field Schema Name").setAttribute("defaulttype", "3");
    Xrm.Page.getControl("Field Schema Name").setDefaultView("3F6D889E-6549-4025-9CE0-4C4103EFB6A3");
    }

    Where "3" is the etc for Opportunity form and,

    "3F6D889E-6549-4025-9CE0-4C4103EFB6A3" is the View Id for "Won Opportunities" View.


    Naren

    • Marked as answer by Sleahy Thursday, September 6, 2012 8:13 PM
    Thursday, September 6, 2012 4:25 AM

All replies

  • Just use http://www.harris-tech.com/blogs/bid/54720/Creating-Filtered-Lookups-in-CRM-2011 as sample.

    You will have to set a filter condition in fetchxml to only "won" opptys and you´re done


    Carsten Groth http://carstengroth.wordpress.com Microsoft Dynamics Certified Technology Specialist CRM Online 30 Tage kostenfrei testen – http://crm.dynamics.com/de-de/trial-overview

    Wednesday, September 5, 2012 6:40 PM
  • Hi Sleahy,

    Write this JScript Code in the Opportunity Lookup Field:

    function view()
    {
    document.getElementById("Field Schema Name").setAttribute("defaulttype", "3");
    Xrm.Page.getControl("Field Schema Name").setDefaultView("3F6D889E-6549-4025-9CE0-4C4103EFB6A3");
    }

    Where "3" is the etc for Opportunity form and,

    "3F6D889E-6549-4025-9CE0-4C4103EFB6A3" is the View Id for "Won Opportunities" View.


    Naren

    • Marked as answer by Sleahy Thursday, September 6, 2012 8:13 PM
    Thursday, September 6, 2012 4:25 AM