Remove Change Status Task
Hi,
Can I remove the change status task from the Hardware Asset view?
Via https://support.cireson.com/KnowledgeBase/View/52?selectedtab=enduser#/ I'm only allowed the change task settings for IR/SR and CR.
Adding HardwareAsset or Cireson to this line isn't helping
app.custom.formTasks.add('AssetManagement', null, function (formObj, viewModel) { formObj.boundReady(function () { $( ".taskmenu li:contains('Assign To Me')" ).hide() }); });
Thanks,
Wouter
Best Answer
-
Jeff_Lang Customer Ninja IT Monkey ✭✭✭✭This can be done without adding a targeted custom form task, although there may be a better way than pasted below, the below works either pasted into or included into your custom.js
$(document).ready(function () {<br> if (window.location.href.indexOf("AssetManagement/HardwareAsset/Edit") === -1)<br> {<br> return;<br> }<br> var mainPageNode = document.getElementById('main_wrapper');<br> var observer = new MutationObserver(function(mutations) {<br> //The page changed.<br> var titleElement = $(".page_title");<br> // check page title actually exists<br> if (titleElement.length > 0) { <br> var csli = $("li:contains('Change Status')");<br> $(csli).hide();<br> //done with observer<br> observer.disconnect();<br> }<br> });<br> var observerConfig = { attributes: true, childList: true, subtree: true, characterData: true };<br> observer.observe(mainPageNode, observerConfig);<br>});<br><br>
6
Answers