- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2014 06:42 AM
Currently any incidents created by self service users has the "contact type" as "phone" which is our default value for the servicedesk. Is there anyway I can get this to change to our "self-service" option by default. On the self service view "contact type" is not a visible field so is set to phone by default when viewed by us and more importantly we cant track how many incidents are being raised by self service users.. Is there a way I can get it to default to self-service when non-itil users raise an incident using the self service view?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2014 07:51 AM
You probably only want the thing to run when it's loaded for the first time...
function onLoad() {
if(g_form.isNewRecord()){
if (g_user.hasRole("itil")) {
g_form.setValue("contact_type","phone");
}
else {
g_form.setValue("contact_type","self-service");
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2014 06:55 AM
Hi Garry,
We have direct option to override the default value of field for tables with dictonary override.
But as for View we dont have direct option, in this case we have to user as fallows
function onLoad() {
var objView = document.getElementById('sysparm_view');
var strView = objView.getAttribute('value');
if (strView == 'ess') {
//set the default value of field
}
Thanks,
Pavan Poul

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2014 08:05 AM
Garry,
You cannot do this with a client script alone as the field is not on the form. I'd add the field to the form as a read-only field. Then, simply control what value it is by setting the field in the module link that is used to open the form. If you control it this way, then even if you use the CTI integration, you can show the same view but set the field to phone. This would be preferable over a client script that sets the value based on the view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2014 09:19 AM
You could put the field on the form and then hide it, but still set it via the onLoad script according to the current view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2014 09:07 AM
Hi Guys,
Thanks for you answers,
Have decided to just set self service as the default value. When this is done the field does not even need to be included on the form, as when ITIL users see it in the default view it defaults to self service. Will just have to get the service desk to remember to change the contact type to phone when we get calls
Thank you both for the help.