OnBefore Transform Script to ignore insert if no record found in gliderecord table:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2015 10:33 AM
I am trying to run an onbefore transform script to check the following
The source employee id to the sys_user employee_number
If no match found ignore the record and do not indert
This is not working
It is still creating records with no user
var empId = source.u_employee_id;
var gr = new GlideRecord('sys_user');
gr.addQuery('employee_number', empId);
gr.query();
while(!gr.next()){
if(action == insert){
ignore = true;
}
}
I have also tried
if(!gr.next()){
ignore = true;
}
That doesn't work either
What am I missing?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2015 03:01 AM
Open the Field map for the mapping - source employee id to the sys_user employee_number
There, you will find the field "Choice Action", select Ignore