Hide Annotation with translation and an onload Client Script

Meloper
Kilo Sage

Hi,

i created the Annotation like this:

find_real_file.png

The ID, i want to use to get access to the Anno the Text is my Key for the translation.

No i tried:

https://community.servicenow.com/community?id=community_question&sys_id=fe50e326db6de700b1b102d5ca96...

https://community.servicenow.com/community?id=community_question&sys_id=3c6c83a5db9cdbc01dcaf3231f96...

but without success.

 

g_form.setDisplay('change_task_annotation', false);

$('change_task_annotation').up().hide();

document.getElementById("change_task_annotation").style.display="none";

 

the checkbox "isolate Script" is unchecked.

If i use the inspect Option of my Browser, i can find my ID...

 

1 ACCEPTED SOLUTION

😄 that is the Solution, in the translated Text, i have now added the <span id=.... to, now it works, thank you

View solution in original post

6 REPLIES 6

Filipe Cruz
Kilo Sage
Kilo Sage

Hello Meloper,

Here is an example from my instance:

function onLoad() {
	addAfterPageLoadedEvent(function(){
		if (g_form.getValue('type') == 'search_result') {
			$('search_result_annotation').up().show();
			$('genius_result_annotation').up().hide();
		} else {
			$('search_result_annotation').up().hide();
			$('genius_result_annotation').up().show();
		}
	});
}

In your case, you need to replace the if statement and the id of the annotation.

In my case, the Isolate Script checkbox was also unchecked.

If this answer is relevant for you, please mark it as correct/helpful.

Thanks,

Filipe

is there any System Property i have to use that this works? I tried it already but i does not work

Hello,

As far as I know, you don't need any system property.

Did you enclosure the code inside the function addAfterPageLoadedEvent(function(){ ?

Ankur Bawiskar
Tera Patron
Tera Patron

@Meloper 

check this link where I shared solution; should work for global or scoped app both

How to hide Annotation Line on Form load.

I was able to hide the form annotation which is present for field using this

gel('my_caller_annotation').style.display = 'none'; // give the html id of your div tag

Ensure your client script has Isolate Script field set as false to allow DOM to work

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader