- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-18-2018 05:15 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-18-2018 05:25 AM
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();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-18-2018 06:17 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-18-2018 10:17 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-18-2018 06:24 AM
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.