stephcrystaluser
Technical User
Hi All,
I have created 2 parameters and appended ".All" to each list. If user wants to select All for the 1st param and an actual value for the 2nd, I need to handle that. I need to handle all scenarios. It seems, I would have to write 4 if statements just to handle all scenarios for these 2 parameters. Is that true? That seems crazy!
Here is the code I wrote:
//Return all data
if {?ApplicationNamesLOV} = '.All' and {?ConflictNamesLOV} = '.All' then
true;
//only filter on conflict name since user selected it
if {?ApplicationNamesLOV} = '.All' and {?ConflictNamesLOV} <> '.All' then
{Conflicts_BE.Conflict Name} = {?ConflictNamesLOV};
//only filter on application name since user selected it
if {?ApplicationNamesLOV} <> '.All' and {?ConflictNamesLOV} = '.All' then
{Conflicts_BE.Application Name} = {?ApplicationNamesLOV};
// filter on both since user selected them
if {?ApplicationNamesLOV} <> '.All' and {?ConflictNamesLOV} <> '.All' then
{Conflicts_BE.Application Name} = {?ApplicationNamesLOV} and
{Conflicts_BE.Conflict Name} = {?ConflictNamesLOV};
Thanks in Advance!
I have created 2 parameters and appended ".All" to each list. If user wants to select All for the 1st param and an actual value for the 2nd, I need to handle that. I need to handle all scenarios. It seems, I would have to write 4 if statements just to handle all scenarios for these 2 parameters. Is that true? That seems crazy!
Here is the code I wrote:
//Return all data
if {?ApplicationNamesLOV} = '.All' and {?ConflictNamesLOV} = '.All' then
true;
//only filter on conflict name since user selected it
if {?ApplicationNamesLOV} = '.All' and {?ConflictNamesLOV} <> '.All' then
{Conflicts_BE.Conflict Name} = {?ConflictNamesLOV};
//only filter on application name since user selected it
if {?ApplicationNamesLOV} <> '.All' and {?ConflictNamesLOV} = '.All' then
{Conflicts_BE.Application Name} = {?ApplicationNamesLOV};
// filter on both since user selected them
if {?ApplicationNamesLOV} <> '.All' and {?ConflictNamesLOV} <> '.All' then
{Conflicts_BE.Application Name} = {?ApplicationNamesLOV} and
{Conflicts_BE.Conflict Name} = {?ConflictNamesLOV};
Thanks in Advance!