Show and Hide annotation onload client script throws error in Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 12:23 AM
Hi All,
We have created a onload client script for annotation show/hide on a sn_hr_core_task table.
But we get some error in portal , Please find the attached screenshots.
function onLoad() {
//Type appropriate comment here, and begin script below
if ((g_form.getValue('u_is_an_extension_granted1') == '1' || g_form.getValue('u_is_an_extension_granted1') == '2') && g_form.getValue('short_description') == 'Localisation date confirmation') {
// Hide the annotation
$('my_annotation').up().show();
} else {
// Show the annotation
$('my_annotation').up().hide();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 11:56 PM
if yes please close the thread by marking the answer correct if not let me know
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 01:14 AM
Hi
Annotation show/hide working fine, but these script throws error in service portal as per attached screenshot. java script error. I have uncheck "isolate script" option but still it is showing.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 12:37 AM
You are using DOM manipulation, make sure your client script has "Isolate script" check box as false on the client script form.
If the field doesn't exist on the form, you can configure form layout to bring the field on the form and set the value as false.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 12:49 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 12:54 AM
Open the form in a new window and try to test it again, make sure your name of the annotation is correct.
This is correct syntax to show and hide annotation, what is the new error you are getting?
Aman Kumar