Data card control logic - Test for value in text variable
Imagine you have a control on your data card that relies on a different text field for its Control Logic, and you want the text control to have to have at least one character in this field before your control is enabled. I run into this issue often with buttons, when I do not want the user to be able to click my button until other required fields on the card are populated first.
Unfortunately in SOLIDWORKS PDM 2017 [Pro or Standard], data card logic doesn’t support wild card characters. As an example, if you set your logic as in this image below, control logic would not gray out the control if the “Description” is empty as we would hope, it would only gray out the control if “Description” doesn’t contain a percent sign.
The best solution I have found is to use “Text is bigger than” or “Text is less than” comparisons. How do you know what text is bigger than another text? -Look up the text in an ASCII Code chart. (I’ll wait while you Google one up.)
If you want to gray out the control if the “Description” is empty, I will usually do something like this:
The exclamation point is number 33 on the chart, it is really the lowest non-blank character you would put on a data card. You could use a space, which is number 32, but usually people don’t want fields to begin with a space, so I think the exclamation point works best.
If you want to force you user to put a number, again look at your ASCII chart, we see zero is before nine so set your logic to look like this:
You cannot enter “bigger than 9” for the second half of the OR statement, because “90” is bigger than “9”, so I use the colon because it is the next character after “9”. Understand though, this doesn’t forbid a user from entering a number followed by some other characters but it hopefully will point the user in the right direction.
Same logic if you wanted to force alphabetical characters -make it gray if the text is less than “A” or bigger or equal to “[“.
Data card Control Logic in data cards is a very fast and intuitive way to force data validation. Look for opportunities to use it whenever you can in your Product Data Management data cards.