List of quotes linked to Opportunity

Hello

Using 7.1g and have been asked to create an ADV Search Select field that will provide a list of all quotes that are linked to an opoprtunity. The idea is that the user will be asked to select which of the multiple quotes on an opportunity is the one that the customer opted for. I can create the Search Select OK but cannot seem to get the filtering right so that it only shows a list of quotes that are linked to the Opoprtunity in questions. Can this be done?

Thanks in Advance

Simon

  • 0

    Simon

    You've been trying to add a search SQL statement to the Advanced Search Select field. The problem is that you can not pass context into the field definition.

    So where the field is defined you can try adding the following into the Search SQL field

    quot_opportunityid = #oppo_opportunityid#

    But this will appear that is does return anything. Actually there would be an invisible error shown in the logs.

    Mar 25 2014 10:57:29.530 10832 10996 1 fselectsql,time,sql,errormsg 15 SELECT TOP 17 Quot_OrderQuoteId, Quot_description FROM vSummaryQuote WITH (NOLOCK) WHERE (Quot_description LIKE N'%' ESCAPE '|' OR COALESCE(Quot_description, N'') = N'') and quot_Deleted is Null and (quot_opportunityid = #oppo_opportunityid#) order by Quot_description Invalid column name '#oppo_opportunityid#'

    What you have to do is use the create script option to change the SearchSQL property in the screen.

    In the screen where the field has been included add the following code into the create script box for the field.

    SearchSQL = "quot_opportunityid = " + CRM.GetContextInfo("opportunity","oppo_opportunityid")

  • 0

    Many thanks Jeff, woks beautifully.