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-20-2022 02:04 AM
Hi there,
If your client script is in scoped app then for executing the DOM manipulation script you need to create a property "glide.script.block.client.globals " with value "false". This will resolve the issue $ is not a function.
Please mark this helpful/correct, if applicable.
Regards,
Muhammad
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2022 05:40 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2022 07:15 PM
Hi,
yes, the property setting looks good. Have you tried your script with any luck?
Please remove the cache of the instance as well after creating this property.
Write cache.do in the application navigator and hit enter.
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2022 11:27 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 06:02 AM
Check the value for that. It should be false if not then please change it to false.
Muhammad