Counting Numbers of Click.

Vivek Verma
Mega Sage
Mega Sage

Requirement - there should be a custom field in the form that displays numbers os click the particular UI action button have been clicked. 

1 ACCEPTED SOLUTION

Tushar Sharma2
Kilo Guru

Hello,

1.Create a field on the form.

2.Create an UI Action on the same form as below.

find_real_file.png

 

'IF' condition is for first time click over the form. If we did not provided the same it will return NAN field will be empty when we will click first time. If you do not want to write 'IF' condition then provide default value to the field from data dictionary and write only else part in the function.

 

Hit Helpful or Correct Answer on the impact of the response.

-Tushar

View solution in original post

11 REPLIES 11

Brian Lancaster
Tera Sage

I would think you could code that into the UI Action.  Get the value the custom field has and add 1.

Tushar Sharma2
Kilo Guru

Hi,

You need to write below code within the same UI action to count the number and set it in the field.

if(g_form.getValue('u_count')=="")  // for fisrt click

{ g_form.setValue('u_count',1);}

else

{g_form.setValue('u_count',(parseInt(g_form.getValue('u_count'))+1));

}

 

Hit like or correct on impact of response.

-Tushar

Hey!

       Would you please give me more codes and details.

    I will surely mark as answered(chill).

Vivek Verma
Mega Sage
Mega Sage

Hey!

       Would you please give me more codes and details.

    I will surely mark as answered(chill).