- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2019 03:39 AM
How to hide Checklist formatter ?
I am using the below onload() client script to show / hide depending on the short description.
Can any one please help how to hide or show the checklist formatter.
function onLoad() {
//Type appropriate comment here, and begin script below
var shortdesc = g_form.getValue('short_description');
//g_form.addInfoMessage('shortdesc:,' +shortdesc);
try{
if (shortdesc == 'Operational Handover Meeting')
{
alert('shortdesc');
//if(!g_scratchpad.checklistVisibility)
//jQuery('#inlineChecklistApp').hide();
document.getElementById("inlineChecklistApp").hide();
// document.getElementById('inlineChecklistApp').style.display="none";
alert('Hello');
}
// else{
// document.getElementById("hide_macro").hide();
// }
}
catch(e){}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2019 06:17 AM
Hello Navya,
1. Make use of Display business rule and add below code:
(function executeRule(current, previous /*null when async*/) {
if (current.short_description == 'Operational Handover Meeting')
{
g_scratchpad.checklistVisibility = false;
if(gs.getUser().isMemberOf(current.getDisplayValue('assignment_group')))
g_scratchpad.checklistVisibility = true;
}
})(current, previous);
OR
If you still want to make use of client script then Check out the configuration OF ISLOATED FIELD ON CLIENT Script:
Configure this form and add "Isolate Script" field
This means to configure the catalog client script form to show the field "Isolate script".
IT need to be set as false :
REASON: New client-scripts are run in strict mode, with direct DOM access disabled. Access to jQuery, prototype and the window object are likewise disabled. To disable this on a per-script basis, configure this form and add the "Isolate script" field. To disable this feature for all new globally-scoped client-side scripts set the system property "glide.script.block.client.globals" to false.
Your client script code should be :
ISOLATED SCRIPT : UNCHECK /FALSE
function onLoad() {
//Type appropriate comment here, and begin script below
var shortdesc = g_form.getValue('short_description');
//g_form.addInfoMessage('shortdesc:,' +shortdesc);
if (shortdesc == 'Operational Handover Meeting')
{
alert('shortdesc');
if(!g_scratchpad.checklistVisibility)
//jQuery('#inlineChecklistApp').hide();
document.getElementById('inlineChecklistApp').style.display = "none";
}
}
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2019 04:03 AM
Hi Navyaa,
Go through below link it might help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2019 06:17 AM
Hello Navya,
1. Make use of Display business rule and add below code:
(function executeRule(current, previous /*null when async*/) {
if (current.short_description == 'Operational Handover Meeting')
{
g_scratchpad.checklistVisibility = false;
if(gs.getUser().isMemberOf(current.getDisplayValue('assignment_group')))
g_scratchpad.checklistVisibility = true;
}
})(current, previous);
OR
If you still want to make use of client script then Check out the configuration OF ISLOATED FIELD ON CLIENT Script:
Configure this form and add "Isolate Script" field
This means to configure the catalog client script form to show the field "Isolate script".
IT need to be set as false :
REASON: New client-scripts are run in strict mode, with direct DOM access disabled. Access to jQuery, prototype and the window object are likewise disabled. To disable this on a per-script basis, configure this form and add the "Isolate script" field. To disable this feature for all new globally-scoped client-side scripts set the system property "glide.script.block.client.globals" to false.
Your client script code should be :
ISOLATED SCRIPT : UNCHECK /FALSE
function onLoad() {
//Type appropriate comment here, and begin script below
var shortdesc = g_form.getValue('short_description');
//g_form.addInfoMessage('shortdesc:,' +shortdesc);
if (shortdesc == 'Operational Handover Meeting')
{
alert('shortdesc');
if(!g_scratchpad.checklistVisibility)
//jQuery('#inlineChecklistApp').hide();
document.getElementById('inlineChecklistApp').style.display = "none";
}
}
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2019 03:21 AM
Any updates on this?
Can you please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
Thanks!
Abhishek Gardade
Hexaware Technologies
Abhishek
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2024 10:30 PM
Thanks this BR work for me. I first created a flow then used this BR to determine when it should display
Thanks so much