- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2020 11:34 PM
There are 5 variables on record producer which are depend on requested_for.
I want to pass the table name of those 5 tables dynamically in script include.
If I will select first variable,GlideRecord will work on first table.If I select Second table GlideRecord will work on second table for all 5 variables.
Solved! Go to Solution.
- Labels:
-
Service Catalog
-
Service Portal
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2020 09:53 PM
Got the Solution:
1.We can simply pass table name inside '' from every variable advance reference qualifier
OR
2.We can make system property having value table name and can pass system property in advance reference qualifier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2020 01:15 AM
Hi both of you,I am working on record producer.
I have written a script include for this.
The data type of 5 variables is reference.
All the work is same but I have to change table name every time so,I have created 5 functions
So,I want that table name to be dynamically used so that I can use one function instead of one
code:
var FaFEMethods = Class.create();
FaFEMethods.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getFaFEMethods: function(requested_for, project) {
var userIds = [];
gs.addInfoMessage(project);
var gr = new GlideRecord('u_project');
if (requested_for == '') {
userIds = userIds.join(',');
return "sys_idIN" + userIds;
} else {
var gr1 = new GlideRecord('core_country');
gr1.query();
while (gr1.next()) {
if (gr1.name == requested_for) {
gr.addQuery('u_country', gr1.sys_id);
gr.query();
while (gr.next()) {
userIds.push(gr.getValue('sys_id'));
}
userIds = userIds.join(',');
return "sys_idIN" + userIds;
}
}
}
},
type: 'FaFEMethods'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2020 09:53 PM
Got the Solution:
1.We can simply pass table name inside '' from every variable advance reference qualifier
OR
2.We can make system property having value table name and can pass system property in advance reference qualifier.