Solved

On the filter section of a DDP detail, can I add an "OR" statement to a DDP filter button?

  • 29 August 2016
  • 3 replies
  • 36 views

I am using a custom button to create DDPs with this URL:

/apex/loop__looplus?eid={!Opportunity.Id}&accountId={!Opportunity.AccountId}&sessionId={!$Api.Session_ID}&filter={!Opportunity.Type}

 

The filter refers to the Opportunity Type picklist field. Can I convert this filter so that it works with more than 1 value? Currently, I put 1 value into the Filter field on the DDP (see screenshot) and this works. However, I would like this custom button to work with 2 of the values of the Opportunity Type field.  Example: Type = Existing Business OR Value2

icon

Best answer by Y_Mushell 29 August 2016, 23:55

View original

3 replies

Hey Kevin Crews​,

You can check against multiple filter values (the equivalent of or, not and) by:

  1. Adding the additional parameter &filtertype=contains to your button.
  2. Adding the values into the filter field as a comma separated list

(This changes the evaluation from a single "equals" comparison, to a comparison against the list of values in the DDP records "filter" field).

You will need to be careful if you have overlapping values though, for example, if you have the value "Existing Business" and want to also allow the DDP for the value "Partner" but not for just a straight value of "Business" the contains evaluator would also mach that.

I believe that if you place each of the values in the comma separated list into parentheses and do the same to the button value (like this [  ...&filtertype=contains&filter=({!Opportunity.Type})  ], that it would prevent that from showing up, but I haven't had extensive experience with it.

Good luck!

That worked for me, thank you!

Hi,
I have similar situation but in other way. I want filter param to have two option to check for. Like in above example along with Opportunity.Type field, can I pass one more value in params something like
filter=({!Opportunity.Type}),({!'ABC})

Regards,
Anoop

Reply