How do you clear a reference fields value for current.fieldname?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2009 09:44 AM
How do you clear a reference fields value for current.fieldname? I found some docs to indicate that I should do the below but it does not work. Can anyone offer any help?
var clearValue;
current.u_affected_item = clearValue;
current.update();
Docs I am refering to.
http://wiki.service-now.com/index.php?title=Resetting_Reference_Fields
- Labels:
-
Orchestration (ITOM)
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2009 10:03 AM
I think that method is for client scripts. You can try 'current.fieldname = '';' or 'current.fieldname = null;'.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2009 10:04 AM
I tryed both of those and they did not appear to work either. I am doing this when the user is hitting the submit button to enter a new incident in the system if that matters.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2009 10:09 AM
So is this in an 'onSubmit' client script or in a business rule? Can you post a screenshot of your entire script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2009 10:17 AM
It is an edit of the "Submit" global UI Action. Action name is "sysverb_insert"
answer = current.insert();
if(current.u_affected_item){
var clearValue;
var tci = new GlideRecord('task_ci');
tci.initialize();
tci.ci_item = current.u_affected_item;
tci.task = answer;
tci.insert();
current.u_affected_item = clearValue;
current.update();
}
gs.include('ActionUtils');
var au = new ActionUtils();
au.postInsert(current);