I would like to put a minimum character length on a description field to would prevent it from being saved if it 5 characters or shorter. Does anyone have an example that this would work with.
client customization, method directive, or data directive? I don’t have examples, but it would be pretty simple to do in any of them. Mostly, what are you comfortable with.
method directive
Just do a condition to check for the length of the field. And if less than 5, raise an exception. Probably put it on the update method.
You’ll need to do a C# expression to check the length of the field, but that’s a quick google search to figure that out.
I use a data directive on a new added record condition and a personalized valid condition with the following code
foreach(var part in ttPart)
{
if(part.PartNum.Length > 40)
return true;
}
return false;
if true, I show an exception widget with a message. This will prevent the save of your new part.
(in your case < 5)
Pierre
thanks guys I appreciate the different ways to skin this cat. Just was stumping me on the best way to do this.
That method is already in the menu as well. Create a variable, the set it using the set variable widget, then you can make the condition to check if the variable is a high enough number.