- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 01:38 AM
Hi,
My Use Case is:
I have a field (u_previous_state) which is stores a String type value. It stores the value of the previous state.
I want to have a button, a UI Action which will change the state of my change request back to the previous state.
Here are the screenshots for the same:
Here -2 is the state value of previous state ('Scheduled' in this case)
My Script is as follows:
Condition- Current state is 'Pending Customer'-> value '-50'
The template is similar to some UI Actions built in in my developer instance.
However, when i click the ui action button, nothing happens. Is there something wrong with this script?
Solved! Go to Solution.
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 02:17 AM
Replace current.u_previous_state with g_form.getValue('state'); for line 3
For line 11 replace alert() with g_form.addInfoMessage('setRedirect function')l
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 01:44 AM
Hi,
On the server side script you are just updating and not doing anything else.
I think you just comment line 3 and add g_form.save(); instead and comment rest out.
You don't need to call the server code at all.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 02:05 AM
Hi Anurag,
I made the change. Still nothing happens when i click the button. Do you think that current.u_previous_state could be returning a null value?
How should i debug this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 02:19 AM
Show me the script you are using.
Paste the script not screenshot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 02:41 AM
Hi Anurag.
current.u_previous_state was not returning any value. I used g_form.getValue('u_previous_state'). It works.
Also g_form.save() works instead of using gsftSubmit like u mentioned.
Thanks!