Creating an image button similar to "bulb" image for suggestion

Sagar Patro
Kilo Guru

I want to add an image at the end of the short description of incident form similar to the "bulb" image.
Is there a way to do this?
Please suggest if any.


Thank you
Vidyasagar

1 ACCEPTED SOLUTION

garyopela
ServiceNow Employee
ServiceNow Employee

Vidyasagar,

You can create a UI Macro and then list the UI macro in the attributes field.
The image would be linked inside the UI Macro.

To see some example UI Macros you might have in your instance, go to UI Macros and search where XML Contains g:reference_decoration and this will help you find some that have images attached. Just copy it and change the image to one you have already uploaded, then take the name of the UI Macro and place it in the attributes field in the definition record of the field to which you want the clickable image attached.


View solution in original post

12 REPLIES 12

You can always store current value of chase count field in a variable(e.g. presentValue) and show the message in infoMessage as "Value changed from   "+presentValue+" to "+presentValue+1"



For the first time to set zero value, you can set a default value as zero for the chase count variable in dictionary.



Above line may have some syntax errors which you need to correct.


Ankit28
Kilo Contributor

I have modified the function per your suggestion as below but it does not displays the value in x and y:



function doSomething() {


var x = g_form.getValue('u_chase_count');


var y = x++;


g_form.setValue('u_chase_count', y);


g_form.showFieldMsg('u_chase_count','Value changed from   "x" to "y" ','info');


}


Below is the tried and tested one. working absolutely fine without any error.



function doSomething() {


var temp = g_form.getValue('u_chase_count');


if(temp =='' || temp == null){


  temp = 0;


}


var newValue = parseInt(temp)+1;


var stringToDisplay = "Chase count increased from "+temp+" to "+newValue;


g_form.setValue('u_chase_count', newValue);


g_form.showFieldMsg('u_chase_count',stringToDisplay,'info');


}