- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2014 10:31 AM
Hi Folks,
I have created a "Async" business rule which does some specific task on Incidents table. I am passing the following arguments from BR as :
var executeJob = new GlideRunScriptJob(); executeJob.scheduleScript("new getData().getDescription('incident','description','"+current.number+"')");
Here 'description' is Incident's field name which I am passing as argument. Now i am using it in one of the function of Script Include as:
getDescription: function(name, field, record) { var oTable = new GlideRecord(name); oTable.addQuery('number',record); oTable.query(); if (oTable.next()){ ... ..... oTable.field = ''Set to some random value....' } }
Now every thing is working as intended but it seems "oTable.field" is not getting parsed at all. Ideally in this case "field" as argument should contain the 'description' but its not happening. I am assuming that Object "oTable" is considering 'field' as one of Incident table field instead of as passed argument, that's why system is not able to parse it correctly.
Can anyone guide me through this if I am missing something here?
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2014 11:16 AM
setValue should work. Did you check other syntax issues?
Can you try as follows and see if that works?
oTable[field] = 'some random value';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2014 10:40 AM
oTable.setValue(field, value)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2014 10:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2014 11:02 AM
Hi Kalai,
Have already tried that but its not working too, any other input ?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2014 11:16 AM
setValue should work. Did you check other syntax issues?
Can you try as follows and see if that works?
oTable[field] = 'some random value';