Alfonso Ventanova
Alfonso Ventanova

Reputation: 47

Filter Condition in Business Object BO

I have a problem with a filter condition in BO. Imagine that I have this database

ID | DESC

0 | None

1 | Company

2 | All

In BO I have a filter that ask where do you want to find the objects and 2 options:

"Company" or "All".

If I choose "All" then I should have all the datas with the "ID" 0,1,2 and if I choose "Company" only the data with the "ID" 1.

So I did something like this:

TABLE_NAME.ID <= (CASE WHEN @Prompt('where do you want to find the objects','A',{'Company', 'All'},mono,constrained,not_persistent,{'Company'}) = 'Company' THEN 1 ELSE 2 END)

This filter is OK when I choose "All" because I have all the "ID" smaller than 2, i.e, 0,1,2.

But It does not work when my option is company, because it also shows the data with the "ID" 0.

I should have some with "=" combined with "<="

Upvotes: 0

Views: 520

Answers (1)

Joe
Joe

Reputation: 6827

If it's really only that simple, the following will work:

TABLE_NAME.ID = 
    (CASE @Prompt('where do you want to find the objects',
            'A',
            {'Company', 'All'},
            mono,
            constrained,
            not_persistent,{'Company'}
            ) 
          WHEN 'Company' 
          THEN 1  
          WHEN 'All' 
          THEN TABLE_NAME.ID
          END)

Upvotes: 1

Related Questions