Showing results for 
Search instead for 
Do you mean 
Reply

How to Validate if a dimension is inbetween min and max Valid Values

Hi all,

 

as I was searching for a way on how to check if a value is inbetween min and max value (not restricted) and I found a solution, I just wanted to share this with the community.

 

Therefore I have the following example:

 

Properties:

LS = 15

LS_Min = 11

LS_Max = 13

 

For the property LS I have not restricted "Valid Values" like in the picture below.

Validation.png

In case that LS is 15 ... it would be out of range.

 

Therefore I create a boolean property "LS_Valid" wich is False by default.

 

In the LS property I use follwoing formular:

Me.Properties("LSValid").InputValue = (Me.Properties("LS").OutOfRange = 0)

 

Otherwise you can also just check the property if it is out of range by using:

If (Me.Properties("LS").OutOfRange = 0) Then

   Result = something

End If

 

I hope this is usefull for other people too.

Best Regards

Christian

5 REPLIES

Re: How to Validate if a dimension is inbetween min and max Valid Values

Hi Christian,

 

I am writing up the TKB from this article and wanted to understand the following:

 

In your examples of how to implement this . . .

 

Me.Properties("LSValid").InputValue = (Me.Properties("LS").OutOfRange = 0)

 

If (Me.Properties("LS").OutOfRange = 0) Then

   Result = something

End If

 

. . .How are the LS_Min and LS_Max values incorporated? How do they get related to .OutOfRange?

 

Thanks,

- Tony

Re: How to Validate if a dimension is inbetween min and max Valid Values

Hi Tony,

 

Regarding the case I was writing we had declared following:

LS = 15

LS_Min = 11

LS_Max = 13

 

So in Case that LS would be 15 … it is higher than LS_Max which is the maximum valid value. In that case it is out of range. Otherwise if LS would be 10 it is smaller than LS_Min which is the minimum valid value. In the UI these property would turn red.

For the validation this is just to check whether it is in or out of range.

 

Did this make sense to you? Or did I not have the right words to explain?

 

Best regard

Christian

Re: How to Validate if a dimension is inbetween min and max Valid Values

I asked around and Trent and Gary provided this additional insight that I was missing.  If it makes sense to you I'll add it to the Knowledge Based article we are deriving from this thread:

 

  • On the Valid Values tab put in a min and max value instead of a formula. Enter 11 in the Min Value and 13 in the Max Value or use a property as shown in the example.  The Valid Values for the Rulestream property to which this all belongs now has a range of 11 to 13.

 

  • OutOfRange determines if the value is outside of the min and max values set using the Valid Values tab of the Rulestream property.

 

Note:

Make sure there is not a Valid Values list because the OutOfRange check does not know how to compare against enumerated ValidValues and will always return 0.  Add < If not (myProp.HasValidValues) Then ... > to check for this.

 

Re: How to Validate if a dimension is inbetween min and max Valid Values

Hi Tony,

 

sounds good to me. In that case you describe two ways and the reader can choose which makes more sense from him.

 

BR

Christian

Re: How to Validate if a dimension is inbetween min and max Valid Values

Hi Christian,

Some of the reviewers (I have been converting this thread into a Knowledge Base article -- our first attempt at this) have suggested you provide an example of the calls to make to help make this as clean as possible. It's my understanding (again, this is our first attempt at this conversion) that by you writing the content you will receive acknowledgement in the KB article.

Please let me know if you have the time to do this,

Thanks,
- Tony