Question
I want to write a script rule in C# to validate if the picture field has any value or not.
Answer
It is possible to validate if a picture field has an image or not by counting regions. If it is empty then the regions count will be 0:
if (Context.Field("pictureField").Regions.Count > 0)
{
//do something
}
else
{
//do something
}
Comments
0 comments
Please sign in to leave a comment.