Need to disable "Publish" option under sharing

Evan2
Kilo Guru

Hi All,

 

I need to disable/hide "Publish" option under sharing of report. It is OOB feature but as per my requirement I want to disable/hide this. Kindly help. PFB the screenshot

 

find_real_file.png

 

Regards,

Nandan

15 REPLIES 15

Just checking on on this one.  Has this question been answered or is there more information I can help you with?  If it's been answered, please mark the answer above as the correct one so people know this has been taken care of.  Thanks!

Dear Mark,

 

The above mentioned BR is not serving the purpose. I am able to publish the report if I have general access to report instead of I am using the BR. PFB the screenshot.

 

https://dev31098.service-now.com/sys_report_display.do?sysparm_report_id=586cb775dfb0010068c37a0d3df263b8

 

Regards,

Nandan

I cannot see your screenshot, but you will not be able to publish a report if this business rule is in place.  As I explained previously, you can't do anything about the front-end UI behavior.  It will look like the report has been published, but if you refresh the page it will not be published.  You can also go to the back-end 'sys_report' table view and see that the 'public' role has not been added and the report is not actually published.

This error message works as described when you're using the "Classic UI" for report builder but not the new UI. Any reason why? Want this to show the error message with both UI's. I confirmed it's still preventing the public role from being added with both but only the classic UI reflects the error message. 

xiaix
Tera Guru

In addition to Marks awesome BR that he provided, I added this global UI Script:

 

var gv_RemoveReportPublishOption_COUNTER_7c97d923db81f3 = 0;
function RemoveReportPublishOption_7c97d923db81f3() {
	try {
		if (window.location.href.toString().indexOf('sys_report_template.do') > 0) {
			
			/* If the <a> element isn't found after 10 seconds, just give up */
			if (gv_RemoveReportPublishOption_COUNTER_7c97d923db81f3 >= 100) {
				console.warn("Could not find report-publish <a> link.");
				return;
			}
			else {
				console.warn("Searching loops: " + gv_RemoveReportPublishOption_COUNTER_7c97d923db81f3);
			}
			
			if (gv_RemoveReportPublishOption_COUNTER_7c97d923db81f3 == 0) {
				console.clear();
			}
			
			setTimeout(function() {
				var aTag = window.document.getElementById('report-publish');
				if (aTag) {
					aTag.parentNode.parentNode.removeChild(aTag.parentNode);
					return;
				} else {
					gv_RemoveReportPublishOption_COUNTER_7c97d923db81f3++;
					RemoveReportPublishOption_7c97d923db81f3();
				}
			}, 100);
		}
	} catch(err){console.warn(err.message);}
}
RemoveReportPublishOption_7c97d923db81f3();

 

find_real_file.png

 

Result:

 

find_real_file.png