Cost center disappears

alliej428
Kilo Contributor

Hi -

I'm running into a funny issue.   When the 'assigned to' field in an asset is changed, the cost center field disappears.   I attached screen shots to show how it's behaving.   Any idea why this would be happening, or how I can get it to stop?   We want to keep that information in there.

before_assignedto_change.png

This is before any changes are made - the cost center shows Leigh Valley

-------------------------------------------------------------------------------------------------------------------------------------------

after_assignedto_change.png

This is after I changed the assigned to field - the department updates, the location changes, and the cost center field changes to blank

Thanks!!

1 ACCEPTED SOLUTION

In that case I would check onChange client scripts running on the assigned to field.


View solution in original post

5 REPLIES 5

Brad Tilton
ServiceNow Employee
ServiceNow Employee

My guess is that you have an onchange client script on the assigned to field that sets the cost center field to the cost center of the assigned to user and the user you selected had no cost center.



When you load the form, right click on the cost center field and Watch it, then add an assigned to. It should tell you the name and artifact type of whatever is changing that field.



Field Watcher


So I checked cost center, and I don't have a 'watch' option.   Only show - 'cost_center'.   I know the location pulls from the assigned to user, but not sure about cost center.


In that case I would check onChange client scripts running on the assigned to field.


Thank you!   I found the script that was changing it.   I'm not familiar with scripting yet, so didn't think to check there.