Create a generic alert message on the user table

SMuir
Mega Guru

Can someone help me with this query please.

We want to create a generic alert message that can be changed.

For example.

Create a tick box called Alert message

Create a text field to show when the alert message has been ticked on a certain user.

Enter the message for example. Blackberry pilot

When a Service Desk Analyst logs a call and selects the user. It will display a message Blackberry Pilot.

If the same tick box and a different message is applied on another user in the user table. Say the message is Laptop pilot it will show that message.

Does anyone know if this will work or done something similar? for example if someone is part of two pilots how can the message be applied?

Kind Regards

Sarah

1 ACCEPTED SOLUTION

Hi Sarah,



I'll assume you have a field on your table called u_active which is a true/false field. You can add that to your script include query (before the msg.query() statement) something like this:



msg.addQuery('u_active', true);



If my assumptions are incorrect, adapt the statement or let me know the field name, type, value, etc. and I can advise.



Thanks.


View solution in original post

25 REPLIES 25

It won't let me use gs.log in the client script anything else I can use?


gs.log() is for server side code.


alert() is a suitable temporary debug for client side.


Hi Chuck,



I have tried adding and alert and navigated to logs and script log statements. Nothing is popping out at me and to be honest it is not making much sense.



I am very new at this and only had a couple of chances to try doing a bit of code. Most of those are a couple of lines in client scripts for Catalog items.



Is there anything else I can try to get this working?



Kind regards


Sarah


Hi Sarah,



Aside from the logging, there's not much more to try via the community. Helping someone troubleshoot code in this manner is a bit challenging.



If you are new to JavaScript, I recommend something like codecademy.com to get your head around the concepts and the ServiceNow Scripting Course to learn the ins and outs of ServiceNow's API.



Scripting in ServiceNow


Thanks Chuck



I totally understand, there is only so far that help can go.



The ServiceNow coding course is planned for this year and I hope to put this towards a developer exam (eventually). I passed my ServiceNow Admin course last year and have done the basic courses for JavaScript via code academy already. Along with HTML and CSS.



I have learned quite a bit this week. So thank you, it's been great. I think my next step is to raise a call with Hi they might be able to see why it is not working.



Kind regards


Sarah