is there a chance that Admin role sys id change during an upgrade?

shakeersha7
Tera Contributor
 
8 REPLIES 8

Aditya_hublikar
Mega Sage

Hello @shakeersha7 ,

 

As per my understanding, all sys_ids for OOTB roles remain the same. Please check once which admin role sys_id you are verifying.

 

If this helps you then mark it as helpful and accept as solution.

Regards,

Aditya

Its_Azar
Mega Sage

Hi there @shakeersha7 

 

Nope not possible.

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.

Kind Regards,
Azar
Serivenow Rising Star
Developer @ KPMG.

nitishraogo
Tera Contributor

Not possible

nitishraogo
Tera Contributor
function waitForMRVSAndHide() {

	var retry = 0;
	var maxRetry = 20;

	var interval = setInterval(function () {

		var container = top.document.querySelector('#sp_formfield_service_commitments');

		if (container) {

			var table = container.querySelector('table');

			if (table) {
				clearInterval(interval);
				hideIdColumn(table);

				// Handle re-render (VERY IMPORTANT)
				observeChanges(container);
			}
		}

		retry++;
		if (retry > maxRetry) {
			clearInterval(interval);
			console.log("MRVS not found");
		}

	}, 500);
}


/************** CORE LOGIC **************/
function hideIdColumn(table) {

	var headers = table.querySelectorAll('th');
	var idIndex = -1;

	headers.forEach(function (th, index) {
		if (th.innerText.trim() === 'Id') {
			idIndex = index;
		}
	});

	if (idIndex === -1) return;

	// hide header
	headers[idIndex].style.display = 'none';

	// hide rows
	var rows = table.querySelectorAll('tr');

	rows.forEach(function (row) {
		var cells = row.querySelectorAll('td');
		if (cells[idIndex]) {
			cells[idIndex].style.display = 'none';
		}
	});
}


/************** HANDLE RE-RENDER **************/
function observeChanges(container) {

	var observer = new MutationObserver(function () {

		var table = container.querySelector('table');
		if (table) {
			hideIdColumn(table);
		}

	});

	observer.observe(container, {
		childList: true,
		subtree: true
	});
}
function onChange(control, oldValue, newValue, isLoading) {
	waitForMRVSAndHide();
}