The Zurich release has arrived! Interested in new features and functionalities? Click here for more

transform map script does not run?

arawat
Kilo Contributor

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 =

ui_action/a315c1539f0120007aaa207c7f4bccff/execute

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.

1 ACCEPTED SOLUTION

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


View solution in original post

8 REPLIES 8

Thank you! That works.


Glad it worked, If I was able to answer your query, can you please mark my response as correct answer so we close this thread.



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


nanurahul
Kilo Explorer

HI Anshuman,




From you query , please try to create the after transform script as you want to validate and Filter out for your target table. SO i would suggest try to make it after transform script and lets give it a try.



and also from the debug output it seems that there is some role based restriction.


so please In a transform map script, you need to use log.info() , log.warn() and log.error()