- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 11:37 PM
Hello Team,
I have a reference field with table as TASK. I have another variable on form which gives option to select the table name for the user (incident, service request, problem).
Whenever user select table name, only those record should be visible in reference field variable, can we achieve this.
Please let me know the approach.
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 06:00 AM
Hi @Sunil31
Why not? there you go!
javascript: current.u_task_type ? 'active=true^assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe^sys_class_name=' + current.u_task_type : 'sys_class_name=-1';
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 01:22 AM - edited 10-24-2023 01:28 AM
Yes you need to update the task_class_name variable from mine to your own variable name.
And also make sure to replace this syntax ":" by ":".
The Reference Qualifier should look like this.
If you would like to show empty record when Task type is selected as None, try the below.
javascript: current.variables.task_type ? 'sys_class_name=' + current.variables.task_type : 'sys_class_name=-1';
You can also call a function from a script include to achieve it.
//Script Include
var CLCatalogItemUtils = Class.create();
CLCatalogItemUtils.prototype = {
initialize: function() {
},
getTableRefQual: function(table_name){
if(gs.nil(table_name)){
return '';
}
return 'sys_class_name=' + table_name;
},
type: 'CLCatalogItemUtils'
};
//Ref Qual
javascript: new global.CLCatalogItemUtils().getTableRefQual(current.variables.task_type);
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 02:54 AM
hello @Tai Vu ,
This will work on time_card table form also right? Somehow im only able to see blank values in reference field when i tried below.
javascript: current.variables.task_type ? 'sys_class_name=' + current.variables.task_type : 'sys_class_name=-1';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 02:57 AM
Hi @Sunil31
Can you help to capture your both variables so I can have better understanding about your current configuration.
To be able to tell where exactly the issue comes from.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 04:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 05:34 AM
Hi @Sunil31
okay I can see the difference now. I was thinking it's a Catalog Variable.
So, just remove the variables part from the script.
Sample below.
javascript: current.u_task_type ? 'sys_class_name=' + current.u_task_type : 'sys_class_name=-1';
Cheers,
Tai Vu