poojam Super Contributor.
Super Contributor.
783 views

Drop-down validation requirement

Jump to solution

Hello Experts,

 I have below requirement in one of my client site,

1. I have two drop-down fields containing different values . 

2. A field for ex: "Level Status" has a value like 'Cascade', 'Production', 'Disposal'

3. Other field "Lifestyle Status " has values like 'a', 'B' , 'C', 'D', 'E'etc

4. Values A,B are related to field "Production" ,  Values C,D are related to field "Cascade" ,  n so on

So if user select 'Production'  from Level Status it should display's a validation as "It's a incorrect value." if slected value other then A,B.

Kindly Help!!!!

 

Regards,

Pooja

0 Likes
1 Solution

Accepted Solutions
Acclaimed Contributor.. Mark Cullen_1 Acclaimed Contributor..
Acclaimed Contributor..

Re: Drop-down validation requirement

Jump to solution

Sounds like table validity attribute use like...

Dim lTrueFalse as Long

lTrueFalse = 1
RetVal = TRUE

IF "Level Status" = "Production" AND InStr(1,"A,B","Lifestyle Status",0) = 0 THEN
   lTrueFalse = 0
ELSEIF "Level Status" = "Cascade" AND InStr(1,"C,D","Lifestyle Status",0) = 0 THEN
   lTrueFalse = 0
ELSEIF "Level Status" = "Disposal" AND InStr(1,"E,etc","Lifestyle Status",0) = 0 THEN
   lTrueFalse = 0
END IF

IF lTrueFalse = 0 THEN
   Err.Raise(-2009,"It's a incorrect value")
   RetVal = FALSE
END IF

View solution in original post

7 Replies
Acclaimed Contributor.. Mark Cullen_1 Acclaimed Contributor..
Acclaimed Contributor..

Re: Drop-down validation requirement

Jump to solution

Sounds like table validity attribute use like...

Dim lTrueFalse as Long

lTrueFalse = 1
RetVal = TRUE

IF "Level Status" = "Production" AND InStr(1,"A,B","Lifestyle Status",0) = 0 THEN
   lTrueFalse = 0
ELSEIF "Level Status" = "Cascade" AND InStr(1,"C,D","Lifestyle Status",0) = 0 THEN
   lTrueFalse = 0
ELSEIF "Level Status" = "Disposal" AND InStr(1,"E,etc","Lifestyle Status",0) = 0 THEN
   lTrueFalse = 0
END IF

IF lTrueFalse = 0 THEN
   Err.Raise(-2009,"It's a incorrect value")
   RetVal = FALSE
END IF

View solution in original post

poojam Super Contributor.
Super Contributor.

Re: Drop-down validation requirement

Jump to solution

Thanks Mark,

I will try this and will post the result here.

 

Regards,

Pooja

0 Likes
GoldenRatioRJP Honored Contributor.
Honored Contributor.

Re: Drop-down validation requirement

Jump to solution

Mark makes a good suggestion.  As with most things in Asset Manager there are multiple ways to go about it.

Another option would be a Write Access Restriction on the Table.

However... It seems rather unfriendlly to have incoherant options available for them to choose.  So another option would be to have several secondary fields rather than just the one.... "ProdStatus"... "CascadeStatus"... etc... each with their own Itemized List and their Relevancy scripted to the "Level Status".  This way only the appropriate field based on the "Level Status" would be availabel and would only have allowed options.

Just some thoughts.  

Russell Parker, CITAM, CHAMP, CSAM
President - Golden Ratio, Inc.
Russ.Parker@GoldenRatioInc.com
GoldenRatioRJP Honored Contributor.
Honored Contributor.

Re: Drop-down validation requirement

Jump to solution

Another thing to consider if going the path of one field and the associated list would be to have values like:

Production - A, Production - B, Cascade - C, Cascade - D

rather than:

A, B, C, D

So it is easier for the User to know which ones are appropriate to pick.  Barring that you could also have a different error msg for each Level Status which indicated what the allowed values were.  It is not User Friendlly to just say "Wrong Answer.  Try Again."

Russell Parker, CITAM, CHAMP, CSAM
President - Golden Ratio, Inc.
Russ.Parker@GoldenRatioInc.com
poojam Super Contributor.
Super Contributor.

Re: Drop-down validation requirement

Jump to solution

Thanks Mark and Russell for your solution!!!!

0 Likes
Established Member.. Nandakishor
Established Member..

Re: Drop-down validation requirement

Jump to solution

Hi Team,

I have modified code as follows but i dont know where to write this script kindly guide 

Dim lTrueFalse as Long

lTrueFalse = 1
RetVal = TRUE

IF "CI_Type" = "Workstation" AND InStr(1,"Desktop,Laptop","CI_SubType",0) = 0 THEN
lTrueFalse = 0
ELSEIF "CI_Type" = "Servers" AND InStr(1,"Physical,Virtual","CI_SubType",0) = 0 THEN
lTrueFalse = 0
ELSEIF "CI_Type" = "Network Devices" AND InStr(1,"Switch,Router,Firewall","CI_SubType",0) = 0 THEN
lTrueFalse = 0
END IF

IF lTrueFalse = 0 THEN
Err.Raise(-2009,"It's a incorrect value")
RetVal = FALSE
END IF

 

 

Thanks In Advance,

Nandakishor G.

0 Likes
Acclaimed Contributor.. Mark Cullen_1 Acclaimed Contributor..
Acclaimed Contributor..

Re: Drop-down validation requirement

Jump to solution

Using Designer application, add to Validity attribute at table level.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.