Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2023 08:43 AM
I have a requirement that when clicked on UI action the field value should get increment. Can anyone please help me with this...
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2023 10:36 AM
You should be able to cast the field value to an Integer and then increment it in the UI Action's script. For example:
var previousValue = parseInt(current.getValue('u_counter')); // get the field value as an integer
current.u_counter = previousValue + 1; // increment the value
current.update(); // update the record
action.setRedirectURL(current); // redirect back to the current record
Hope that helps!
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2023 10:36 AM
You should be able to cast the field value to an Integer and then increment it in the UI Action's script. For example:
var previousValue = parseInt(current.getValue('u_counter')); // get the field value as an integer
current.u_counter = previousValue + 1; // increment the value
current.update(); // update the record
action.setRedirectURL(current); // redirect back to the current record
Hope that helps!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2023 10:51 AM
Thank you....