How to use sysparm_referring_url from incident.do?

juliechen
Kilo Explorer

when I use incident.do with sysparm_referring_url=sys_user.do%3fsys_id..., how can I get location for this user populated on the new incidence?

1 ACCEPTED SOLUTION

Julie, ok I see what you are referring to now.   The out of the box "(BP) Set Location to User" client script on incident that populates the location from the caller is set as an onChange script.   In this script there is the following (best practice):


if (isLoading)


          return;



What this means is when the form is loading, the script stops.   So in the case of CTI, the caller is populated as/before the form loads, thus this script never executes.   My recommendation is:


  1. Clone this out of the box script (deactivate original so you won't impact upgrades) and modify it to check for the existence of a caller and populate
  2. Create a new onLoad script to check for the existence of a caller and set it.

View solution in original post

7 REPLIES 7

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Julle,



You can check for dot-walkin in servicenow. If the caller is populated then the location will be autopopulated.


Dot-Walking - ServiceNow Wiki


Pradeep,



Thank you for your quick answer! Actually, I call from cti.do, when there are tickets under the caller, the script will call sys_user.do?... from there, when I try to create a new incident, the location field cannot be populated. That's my question is about.



Thanks again,


Julie


Hi Julie,



Sorry if I still didn't get it. All I'm saying is if you populate the caller info on during the creation of incident then the location will be autopopulated.


Julie, CTI out of the box takes you to the user record as you describe.   When it does you can also pass in additional attributes using sysparm_xxxx=value where 'xxxx' is the name of a field within the 'incident' record that should be populated with the specified 'value'.   Then when you click on the New button on the incident related list it will create a new incident for this caller and set any additional field you pass in.   So unsure on your question if you are passing the location in from the CTI client or if you are expecting it to populate when the new incident is created.



Out of the box there is a client script that sets the location to the caller's location so unsure why that wouldn't kick in if that is what you desire too.