UI Action Script Not working - State Change

Mudit4
Kilo Expert

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:

find_real_file.png

Here -2 is the state value of previous state ('Scheduled' in this case)

My Script is as follows:

find_real_file.pngCondition- 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? 

1 ACCEPTED SOLUTION

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

View solution in original post

11 REPLIES 11

Anurag Tripathi
Mega Patron
Mega Patron

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

-Anurag

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?

Show me the script you are using.

Paste the script not screenshot

-Anurag

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!