Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

when the page is loaded display the short description as incident number+catgory+channel in onload

prasadservi
Giga Contributor
 
5 REPLIES 5

Nishant8
Giga Sage
Giga Sage

Hello @prasadservi , I'm wondering whether you'd need this behavior for already submitted Incident too...Imagine, if user opens any INC that is already submitted with different value than this combination, then user will not see original value anytime. You may plan to implement this when INC is going to be submitted ( this is just a thought from my side, please ignore if its otherwise)

If you wish to implement this for new INC then you can try below piece of code:

function onLoad() {
    if (g_form.isNewRecord()) {
        var value = g_form.getValue('number') + "-" + g_form.getValue('category') + "-" + g_form.getValue('contact_type');
        g_form.setValue('short_description', value);
    }

}

 

Regards,

Nishant