- 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 11:49 AM
syntax seems the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2014 11:50 AM
from
oTable.field = ''Set to some random value....'
to
oTable.field = 'Set to some random value....';
it has 2 single quotes at the start of the string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2014 11:42 AM
You may have tried that, but I do not see an "update" in your Script Include that would actually update the record.