Seeking Use Cases and Examples for ServiceNow Development Components
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 09:27 PM
Hello everyone,
I'm eager to deepen my understanding and practice of ServiceNow development components like Client Script, Business Rules, Script Includes, and UI Actions. Could you please share some use cases or examples where you've effectively utilized these components in your projects?
I'm particularly interested in real-world scenarios or common tasks where these components come into play. Any insights, tips, or snippets of code would be greatly appreciated!
Thank you in advance for your contributions!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 11:39 PM
Hi @Snow-Man,
Below are real-world scenarios and examples where I've effectively utilized ServiceNow development components:
Client Script:-
Q)when the page is loaded on the alert box am in need of displaying incident number + category and short Description to blink 5 time in yello color.
Solution:-
function onLoad() {
alert('INC Number and Cat are' +g_form.getValue('number') +g_form.getValue('category'));
g_form.flash('incident.short_description','#3cb371',-2);
}
Q)on change of category if category database, short description to be set with current caller , incident number, category and make description mandatory if category is not database then clear all the value.
Solution:-
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (g_form.getValue('category') == 'database') {
g_form.setMandatory('description', true);
var test = g_user.getFullName() + ' ' + g_form.getValue('number') + ' ' + g_form.getValue('category');
g_form.setValue('short_description',test);
//g_form.setValue('short_description',g_user.getFullName() + ' ' + g_form.getValue('number') + ' ' + g_form.getValue('category'));
}
else{
g_form.clearValue('short_description');
}
Q)if category selected is software and Chanel selected as phone on the alert box print the both details and make assignment group mandatory with value as software.
Solution:-
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (g_form.getValue('category') == 'software' && g_form.getValue('contact_type') == 'phone'); {
alert("the category is" + g_form.getValue('category') + ' ' + "the contact medium is" + ' ' + g_form.getValue('contact_type'));
g_form.setValue('assignment_group','software');
g_form.setMandatory('assignment_group',true);
}
}
Please mark this comment as if it helped you.
Regards,
Samiksha Gunjate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 11:48 PM