- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 05:10 AM
Hi All,
I am trying to create an inbound web service which has a 'onBefore' transform script. I want to use it to filter input for my target table. But from whatever little I know, it seems the script is not executing. Enabling all debugging, I see some errors.
I see a lot of these -
05:03:20.747: Attempted script access to inaccessible member denied - com.glide.script.ElementDebugMessage:getType:()Ljava/lang/String
& some of these -
05:03:20.756: App:Dashboards TIME = 0:00:00.000 PATH = ui_action/a315c1539f0120007aaa207c7f4bccff/execute CONTEXT = onBefore RC = false Rule =
|
I have no idea what they mean. My script is as follows:
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
var user = source.u_user_name;
var id = source.u_id;
gs.log('Adding row for agent id ' + id, 'TransformMap');
var querystring = 'user=' + user + '^ORusernamealias=' + user;
var mem = new GlideRecord('x_91069_das_members');
mem.addEncodedQuery(querystring);
mem.setLimit(1);
mem.query();
if (mem.next()) {
if (mem.type != 'AGENT') {
ignore = true;
gs.log('Import row for non-agent id ' + id + 'ignored.', 'TransformMap');
}
else {
gs.log('Import row for agent id ' + id + 'added.', 'TransformMap');
}
}
else {
gs.log('Import row for unknown id ' + id + 'added.', 'TransformMap');
}
})(source, map, log, target);
Any idea what am I doing wrong here?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2017 11:21 PM
You need to go to System Import Sets -> Transform History and select your related import set. It would contain the logs added by log.function();
Thank You
Please Hit Like, Helpful or Correct depending on the impact of response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2017 10:21 PM
Never mind. Seems like gs.log and gs.print are not available in transform map scripts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2017 10:29 PM
Hi Anshuman,
In a transform map script, you need to use log.info() , log.warn() and log.error()
Thank You
Please Hit Like, Helpful or Correct depending on the impact of response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2017 11:17 PM
Thanks for that. However, where do these get printed? I have enabled all logging, but it doesn't contain my logs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2017 11:21 PM
You need to go to System Import Sets -> Transform History and select your related import set. It would contain the logs added by log.function();
Thank You
Please Hit Like, Helpful or Correct depending on the impact of response