- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2022 10:20 PM
Try using,
javascript:"u_plant=" + current.variables.u_plant;
Regards,
Rahul
Thanks and Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2022 10:32 PM
Hi Rahul,
I have tried it. It is not even returning a single record.
Thanks,
Yesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2022 10:41 PM
Hi Yesh,
Than its better to go the way by script include as you are going,
Suggested by @Nikhil
Try changing your script as:-
uniqueCat: function(plant) {
var pList = [];
var plan = new GlideRecordSecure('x_rfq_module_categories');
plan.addQuery('u_plant', plant);
plan.query();
while(plan.next()) {
gs.addInfoMessage(plan.u_category);//here i am getting all categories which are matched with plant name
pList.push(plan.getValue('sys_id'));// Make a change here.
}
return 'sys_idIN' + pList.toString();//only returning the last record
}
Regards,
Rahul
Thanks and Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2022 09:59 PM
Hi
Please create a new script include with the following function, also make sure its client callable:
getCategory: function(plant) {
var refQuery = '';
refQuery = 'category=plant';
return refQuery;
},
After this, use advanced reference qualifier and use the below code for calling your script include:
javascript: yourScriptIncludeName().getCategory(current.variables.plantName);
However, if its a scoped application, then you will have to append the application name before yourScriptIncludeName() in reference qualifier
Note: Make sure that you change the variable name as per the name in your system.
Mark as correct if helpful!
Thanks,
Nikhil.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2022 10:06 PM
Hi
I have trued the below script. But is returning only one record. Can you help me?
uniqueCat: function(plant) {
var pList = [];
var plan = new GlideRecordSecure('x_rfq_module_categories');
plan.addQuery('u_plant', plant);
plan.query();
while(plan.next()) {
gs.addInfoMessage(plan.u_category);//here i am getting all categories which are matched with plant name
pList.push(plan.sys_id);
}
return 'sys_idIN' + pList.toString();//only returning the last record
}
Thanks,
Yesh