コミュニティ

Error or Warning message for Repeating Group

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.

 

この記事は役に立ちましたか?

0人中0人がこの記事が役に立ったと言っています

コメント

2件のコメント

  • Avatar
    Anand Babu M

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

    0
  • Avatar
    Permanently deleted user

    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...

    0

サインインしてコメントを残してください。