Can a UI Action display a different label after being pressed once?

PaulShea
Kilo Explorer

I have a weird situation.
I have a client script UI Action 'Re-open Incident' visible for closed incidents.
When pressed, the user is prompted to enter a comment and a field message tells the user to 'Please enter a comment when reopening an Incident and then press 'Submit'.

Is it possible to relabel the UI 'Re-open Incident' to 'Submit' after the button is pressed so I don't need to introduce another UI?

7 REPLIES 7

Thanks very much!


poyntzj
Kilo Sage

One of our testers did find a problem this morning with the Client script


It all works, but when he clicked on the Date Selector, the button was fubar.


i could not quite understand as the Client script was only hiding the correct buttons, but disabling it and the dates worked, enabling and they did not. (I must admit I was only looking at the button hiding / showing as expected)


In the end I found out the issue is the variable called "inner"


I changed that to be "ButtonPhrase" and the buttons still hide and the Date selectors are working


you need to update the client script and the UI Action


Slava Savitsky
Giga Sage

You should be able to accomplish it by putting the following code in the Onclick field of the UI Action record:



var oldName = this.innerHTML; var newName = oldName.replace('Re-open Incident', 'Submit'); this.innerHTML = newName;