Seeking Use Cases and Examples for ServiceNow Development Components

Snow-Man
Tera Contributor

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!

2 REPLIES 2

Samiksha Gunjat
Kilo Guru

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

Harish Bainsla
Tera Sage
Tera Sage
servicenow #skfacts #servicenowdeveloper #ServiceNow #ITSM #ITIL #ServiceManagement #ServiceDesk #IncidentManagement #ChangeManagement #CMDB #Automation #DigitalTransformation #ServiceNowAdmin #ServiceNowDevelopment #ServiceNowCommunity #ServiceNowTraining #ServiceNowIntegration students can log ...
Hi Youtube Family, In this video you will Learn about all the Basic of Display Servicenow the business rule concept. If you guys enjoyed it, make sure to Like👍 , Comment💬 and Subscribe❤️ I am Ravi Gaurav. I am Expert in ServiceNow . Welcome to my youtube channel. ServiceNow Business Rule | Display
Hi Youtube Family, In this video you will Learn about all the Basic of Display Servicenow the business rule concept. If you guys enjoyed it, make sure to Like👍 , Comment💬 and Subscribe❤️ I am Ravi Gaurav. I am Expert in ServiceNow . Welcome to my youtube channel. ServiceNow Business Rule | Display