locked
Filtred lookup Opportunity on the quote entity RRS feed

  • Question

  • Hi all ,

    I want to filter the Opportunity lookup on the quote form to get just the opportunity for the the account that montioned on the customerid field.

    but the problem is that the customer type of the opportunity can be an account or a contact. so haw can I specify in the filter to get the list of the Opportunity with a customer of account type not contact type.

     var accountid;
    var lookupItem = new Array;
    if(crmForm.all.customerid.DataValue!=null)
    {
      lookupItem = crmForm.all.customerid.DataValue;
      
      if (lookupItem[0] != null)
      {
       accountid=lookupItem[0].id;
       alert('accountid '+accountid);
       var opportunityidLookup = crmForm.all.opportunityid;  

       // Set product filter to packages
       opportunityidLookup.lookupbrowse = 1;
       opportunityidLookup.AddParam("search", 
       "<fetch mapping='logical'><entity name='opportunity'>"
       + "<filter><condition attribute='customerid' operator='eq' value='"+accountid+"'"
       + "/></filter></entity></fetch>");
      }
    }

    Saturday, May 1, 2010 10:00 AM

Answers