Error or Warning message for Repeating Group

  • 64 Views
  • Last Post 28 September 2018
Stephen posted this 28 September 2018

Hi all,

I have a field which is a repeating group and would like to alert user if any one of them is blank.

 

So I apply the code in C# like this.

 

Code Start:

using System;

 

int TotalCount=Context.Field("Reference").Items.Count;

 

for (int i=0;i<TotalCount;i++)

{

    string tmpResult = Context.Field("Reference").Items[i].Text;

   

    if(tmpResult==""){

        Context.CheckSucceeded = false;

        Context.ErrorMessage = "Transaction Reference is blank!";

    }

 

}

Code End

The code will eventually warn user but highlight the entire table.

How can I adjust the code so it ONLY highlight the blank field?

It will looks more user-friendly and make sense.

 

Thanks in advance.

 

Attached Files

Order By: Standard | Newest | Votes
Abbyy_user0707 posted this 28 September 2018

Instead of coding you can use Cannot be blank option in field properties. Refer attached screenshot

Attached Files

Stephen posted this 28 September 2018

I tried "Cannot be blank" option.It works.

 

But sorry for missing one important message, I need to pop up a yellow box as error but not red, so coding is needed.

 

I am really sorry for the miss...

Close