- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
54m ago
Hello everyone,
I have created a new formatter and this is the UI macro for this Formatter.
function onChange(control, oldValue, newValue) {
setTimeout(function() {
var wrapper = document.getElementById('refreshWrapper');
if (!wrapper) return;
wrapper.style.display = newValue ? 'flex' : 'none';
}, 300);
}
However this does not seem to be working. Do you any recommendations or ideas about what might be wrong ? Any help would be appreciated.
Best Regards,
Beyza
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12m ago
the only way is DOM manipulation which is not recommended practice
Ensure for your client script Isolate Script = False
This field is not on form but from list you can make it false
are you using the correct HTML element ID for that -> refreshWrapper
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
32m ago
Hi @beycos
Refer this post: https://www.servicenow.com/community/itom-forum/how-do-you-hide-a-formatter/m-p/985505
Try something like it:
document.getElementById("[the id of the HTML element]").style.display = "none".
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12m ago
the only way is DOM manipulation which is not recommended practice
Ensure for your client script Isolate Script = False
This field is not on form but from list you can make it false
are you using the correct HTML element ID for that -> refreshWrapper
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader