- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2024 04:33 AM
hi i created a record producer and i want to show all variable value in my case form too, so i added variable editor. now my case form is also showing empty variable also, how can i remove empty field. these fields are mandatory, but it is working on ui policy i created on record producer. i want only that variables that user have filled in record producer from portal.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2024 03:45 PM
Catalog Client Scripts and Catalog UI Policies have attributes that can be checked to apply it on the item, target task or target record or all. Use the one that fits your needs to hide the appropriate variable(s) and check the box(es) where appropriate.
Catalog Client Script
Catalog UI Policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2024 08:30 AM
Hi @Deepanshi1 ,
Follow the steps below to achieve this:
1. Write a display BR on your Case table and use the script shared below:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var arr = [];
var gr = new GlideRecord('question_answer');
gr.addQuery('table_name',current.getTableName());
gr.addQuery('table_sys_id',current.sys_id);
gr.addEncodedQuery('valueISEMPTY');
gr.query();
while(gr.next()){
arr.push(gr.question.name.toString());
}
g_scratchpad.hideVariables = arr.toString();
})(current, previous);
2. Now write an On Load Client Script on Case table and use the script shared below:
function onLoad() {
//Type appropriate comment here, and begin script below
var getVariables = g_scratchpad.hideVariables.split(',');
for(var i=0 ; i<getVariables.length;i++){
g_form.setDisplay(variables.getVariables[i],false);
}
}
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2024 03:45 PM
Catalog Client Scripts and Catalog UI Policies have attributes that can be checked to apply it on the item, target task or target record or all. Use the one that fits your needs to hide the appropriate variable(s) and check the box(es) where appropriate.
Catalog Client Script
Catalog UI Policy