Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question relating to thread767-1248948

Status
Not open for further replies.

lauriesamh

Technical User
Sep 1, 2004
119
US
I'm using CR10 and have a parameter value (allows multiple values to be selected) to search by product code. I'm using the formula from the above thread to have the user select "" or 000 if they want to pull all product codes....

If
( IsNull({?Prod code(s)}) or Trim({?Prod code(s)}) = "" or {?Prod code(s)} = 'DefaultValue')
Then
True
Else
{Table.field} = {?Prod code(s)}

I keep getting the error "This array must be subscripted". I assume it is due to the multiple value option for the parameter. Since I don't know how many parameter values the user might select, any ideas to modifying the code?
 
I can't recreate your error. Is this your entire record selection formula? Are you sure the error is attributable to this set of clauses?

-LB
 
LB - my problem is if I set the {?Prod code(s)} to allow multiple values.

The Selection Forula is:
@Null: If ( IsNull({?Prod code(s)}) or Trim({?Prod code(s)}) = "" or {?Prod code(s)} = 'DefaultValue')
Then True Else {Table.field} = {?Prod code(s)}

The entire record Selection formula is:

if {@null} = True then
({CDCB.CDCB_SAV} <> $0.00 and
{CMC_GRGR_GROUP.GRGR_ID} = "XXX" and
{Product.STS} in ["02", "91"] and
{Product.STS_DTM} >= {?From Date} and
{Product.STS_DTM} < DATEADD("d",1,{?To Date}) ) else


({CDCB.CDCB_SAV} <> $0.00 and
{CMC_GRGR_GROUP.GRGR_ID} = "XXX" and
{Product.STS} in ["02", "91"] and
{Product.STS_DTM} >= {?From Date} and
{Product.STS_DTM} < DATEADD("d",1,{?To Date}) and
{CDML.IPCD_ID} in {?Prod Codes code(s)})
 
Try:

(
if
(
IsNull({?Prod code(s)}) or
Trim({?Prod code(s)}) = "" or
{?Prod code(s)} = 'DefaultValue'
) then true else
{CDML.IPCD_ID} = {?Prod Codes code(s)}
) and
{CDCB.CDCB_SAV} <> $0.00 and
{CMC_GRGR_GROUP.GRGR_ID} = "XXX" and
{Product.STS} in ["02", "91"] and
{Product.STS_DTM} >= {?From Date} and
{Product.STS_DTM} < DATEADD("d",1,{?To Date})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top