Get UI action click count

Developer14
Kilo Expert

I have a requirement to create a UI action on incident form and when the user clicks the button for 3rd time, i need to set the state to resolved and add resolution code and notes.

I created a UI action 'Caller' as form button on incident form. I am stuck at the point where i need to calculate the number of times the UI action button is clicked. 

If any one have worked on this before  could you please help me.

1 ACCEPTED SOLUTION

u_click_count can be a field of String type with default value as 0

if(current.u_click_count == '3'){

current.state = 6;
current.close_code = 'Your_value';
current.close_notes = "Your_value";
current.update();

}else{
//Increment your clicks
current.u_click_count = parseInt(current.u_click_count)+1;
current.update();

}

View solution in original post

7 REPLIES 7

The UI Action does not store the number of clicks. If you are in the same session (ie opened the form and clicked it thrice same time), it might work but once you close the form, the values will get reset.

 

 

OK..i tried creating a field on the form and tried the above logic. But whenever i click the form button, count is not getting incremented, its always showing 0. So i tried using g_form instead of current then it worked.

Hello,

I would create a custom table and have the details stored there if field creation is not an option.

 

Note: Please mark reply as correct if it helps or answers your question.