The CreatorCon Call for Content is officially open! Get started here.

How to redirect URL in servicenow

sam1212
Mega Expert

Hi ALL,

Some users are trying to use   https://Instance.service-now.com/incident.do or     https://instance.service-now.com/incident.do?sysparm_stack=incident_list.do&sys_id=-1   to create incident is it possible to navigate to different URL(catalog URL)

Any help is appreciated

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

In previous releases, interceptor could have taken care of this but it is legacy now.



I assume you are using record producer or catalog to create the records. If that is the case, I can suggest a workaround for this.



  • Create a display business rule on the table with the below condition
    • current.isNewRecord()
    • Set the value to scratchpad to indicate that the new record was accessed directly.
      • g_scratchpad.invalid_access='true';
  • Create/reuse any existing onload client script on the table and use something like below to redirect.

                  if(g_scratchpad.invalid_access=='true')


                                {


                                          alert("Access to this form is denied");


                                          window.location.href = 'com.glideapp.servicecatalog_category_view.do?v=1&sysparm_parent=e15706fc0a0a0aa7007fc21e1ab70c2f&sysparm_catalog=e0d08b13c3330100c8b837659bba8fb';


                                }


View solution in original post

6 REPLIES 6

Abhinay Erra
Giga Sage

Yes, it is possible to redirect to a URL. Can you elaborate your use case?


Hi Abhinay,



So elaborate little , we have a record producer to create incident by   ESS user with a detailed information required from them but they are trying these url to create incident without providing full info about the incident.


Kalaiarasan Pus
Giga Sage

In previous releases, interceptor could have taken care of this but it is legacy now.



I assume you are using record producer or catalog to create the records. If that is the case, I can suggest a workaround for this.



  • Create a display business rule on the table with the below condition
    • current.isNewRecord()
    • Set the value to scratchpad to indicate that the new record was accessed directly.
      • g_scratchpad.invalid_access='true';
  • Create/reuse any existing onload client script on the table and use something like below to redirect.

                  if(g_scratchpad.invalid_access=='true')


                                {


                                          alert("Access to this form is denied");


                                          window.location.href = 'com.glideapp.servicecatalog_category_view.do?v=1&sysparm_parent=e15706fc0a0a0aa7007fc21e1ab70c2f&sysparm_catalog=e0d08b13c3330100c8b837659bba8fb';


                                }


Hi kalaiarsanan,



Thanks i will try this and update you.