g_form.flash on a related list?

s_rgioc
Kilo Contributor

Hi,

I have client script that triggers on submit of a specific UI Action. It's working well but I would like to bring the User's attention to a related list in the form if a certain condition is met.

g_form.flash seems like a good way to do that BUT I don't know how to apply it to a related list.

Is it possible?

Thank you.

1 ACCEPTED SOLUTION

Ankush Agrawal
ServiceNow Employee
ServiceNow Employee

Hi Sergio



This is not possible with OOB g_form.flash. The function is designed to use the label which is not present in the related list. You have to create a new method for the same.


Below is a quick snippet to get the list of all the headers of the related lists. You can play around to get the exact focus.


document.getElementById('tabs2_list').getElementsByClassName("tabs2_tab")



Please let me know if you want further help.


View solution in original post

11 REPLIES 11

Tim Deniston
Mega Sage
Mega Sage

I don't think this is possible without some crazy DOM manipulation. You could probably accomplish it with jQuery, but it wouldn't be recommended (and would probably break during an upgrade).


It's a simple Client Script, don't want to get into much DOM manipulation. I'll stick to just a message. Thank you.


stefan_ojeblom
ServiceNow Employee
ServiceNow Employee

Hi Sergio,


Client scripts have no effect at all on fields in a list view.


Perhaps you could use a field style definition on your related list instead to get the user's attention.



Take a look at this wiki article and see if that gives you some ideas on how to solve your question;



Defining Field Styles - ServiceNow Wiki


Thank you, but I just wanted to get the user's attention on a specific action. Simple stuff, I'll just show a message.