how to change value of reference field from some value to blank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2016 06:47 AM
Hi ,
I am trying to populate a reference field from transform map using field map script. I need to clear out this reference field value sometimes, through field script. so i have given value ='NULL' in the else condition of script.. but it is creating below problems
1. first of all it was not clearing the field value at all.
2. when i have created a null value in the referenced table, then it is clearing field value but it is not making it null, means in the filter it is showing it has empty value, but i want to make this value as blank.
here is my questing is it possible to make reference field value as blank? or
To change reference field value to blank always we need to create an empty field in referenced table?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2016 11:55 PM
your first line in the script should be like below...
var managedBy = 'NULL';
pls try and confrim.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 12:14 AM
'NULL' and 'null' are working in same way..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 12:30 AM
Below code I am using in one of my scheduled job...which properly setting empty value in "assigned_to" which is a ref field....can you share ur code where you setting the value into ur glide record field.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
var B= new GlideRecord('incident');
B.addQuery('sys_id',A.u_ticket_id);
B.query();
if(B.next())
{
if (arrSplit[0].toString() == 'undefined')
B.assigned_to = 'NULL';
else
B.assigned_to = arrSplit[0].toString();
B.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 01:40 AM