Wierd Question

ka4niv

Active Member
Want to prevent users from using normal data selection on a report, so tried
using SET USER SELECTION event rule statement. The wizard does not appear to
allow multiple comparisons in one statement.

Anyone know how to do that?


TIA
Maurice Rice
Delta Woodside Industries

XE sp:14 ES:400 Citrix/NT/2000
 

Ray Justus

Reputable Poster
Wierd Question Set User Selection Programmatically

Maurice,

You need to use multiple ER lines. See example below:

Set User Selection(BC Date - Terminated (F060116), <Greater Than or Equal To>, RV Beginning Date, <And>)
Set User Selection(BC Date - Terminated (F060116), <Less Than or Equal To>, RV Ending Date, <None>)

Ray W. Justus
Kitchell Corporation
1707 East Highland Avenue, Suite 100
Phoenix, AZ 85016-4668
(602) 631-6157
 

ka4niv

Active Member

Sef

VIP Member
Re: Wierd Question Set User Selection Programmatically

Hi Maurice and R.Justus

Unfortunately "Set user selection" does not allow multiple selection criteria. When you wish to use a listing (not a range of data), the only method I can think of is to use a multitude of statements combined by 'OR'.

As you can't use brackets, you also need to be careful about the sequence of selections as 'AND' will preceed 'OR' and you may need to repeat user selections (be careful when you copy as you need to confirm each selection criterium by manualy reselecting!)

It is also my believe that the And/Or indicator refers to the previous line not the current.

Can somebody confirm whether the correct statement is:

Set User Selection(BC Date - Terminated (F060116), <Greater Than or Equal To>, RV Beginning Date, <And>)
Set User Selection(BC Date - Terminated (F060116), <Less Than or Equal To>, RV Ending Date, <None>)

or

Set User Selection(BC Date - Terminated (F060116), <Greater Than or Equal To>, RV Beginning Date, <None>)
Set User Selection(BC Date - Terminated (F060116), <Less Than or Equal To>, RV Ending Date, <And>)

Also when using a multitude of nested statements, I have had occasions where the selection criteria are incorrectly executed. Does somebody have similar experiences?

Two last comments that may help:

* Don't forget to call system function "Set Selection Append Flag" = NO

* If the data selection gets too complex you can always insert an 'if statement' in the Do section, which does allow multiple criteria:

eg:

If BC xxxxxx is equal to <literal list of values>

Further ER

else

Suppress Section write

Endif

This will slow down the data selection, but ensures a correct outcome

Good Luck,

Sef
 

Zoltan_Gyimesi

Legendary Poster
Re: Wierd Question Set User Selection Programmatically

Hi Sef, Maurice and R.Justus

Sef, You Are Welcome on the JDEList Forums/Lists.

Not too far in the past, Christian Audet has started also thread about the problem, how to set selection on List of Values inside an UBE.

I had had an untested hint for him:
1.) Create a dummy section with the same Business View.
2.) Define Data Selection for the dummy section in the Section menu. The Range of Values and List of Values tab will be now available for you.
3.) Use the "Use Data Sel/Seq from a Section" System Function (General Category) in your original Section.

Please, let me know that does it works or not. I am really curious to it.

Regards,
Zoltán

B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
 

ka4niv

Active Member
Re: Wierd Question Set User Selection Programmatically

Sef ...

Set User Selection( ... <And>)
Set User Selection(... <None>)

Works for me.

I also noticed that it is possible to Set Selection Append Flag =YES and
allow the user to append their own selection criteria. I am still playing
with that feature.

Thanks for the advice.


Maurice
 

Sef

VIP Member
Re: Wierd Question Set User Selection Programmatically

Hi Zoltan,

Great suggestion! I just ran a few basic trials and your solution works a treat. There's even no need to call this section at all. All you need to do is create it and hide it.

I also ran a few tests to see how the selection statements interact.
It seems the following "hierarchy" exists.

When you use <Set User Selection> with <Use Data sel/seq from a section>, only the <Set User Selection> is used.

When you set <Set selection append flag> = Yes and add some data selection at run time, only the <Use Data sel/seq from a section> is used.

Rgds,

Sef van den Nieuwelaar
Australia
B732 on NT, XE on NT, B732/A73 on AS400, B733 on NT
 
Top