First, I would advise you not to rely on the ToString() method on objects if it is not documented. In this case, it works with the abstract class ItemField , but this may not always be the case.
The TOM.Net API only defines the definition and name properties for the ItemField , so you need to make the ItemField object more specific.
the abstract TextField class that inherits from SingleLineTextField defines the ToString() method, as well as the Value and Values properties, which are much better for what you are trying to do. After looking at the documentation, we can see that Values will give us IList<String> values, even if your field is not ambiguous. Excellent!
So, to answer your question: โI was looking for some way to find out if SingleLineTextField has more values โโin itโ, you need to specify your ItemField as TextField and check the number of values โโit provides, this way:
TextField textField = (TextField)itemField;
source share