Show and Hide annotation onload client script throws error in Portal

abirakundu23
Mega Sage

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();
    }

}

19 REPLIES 19

Hi Aman,

We are getting same portal error, that attached in screenshot .

Hi @Mohith Devatte / Aman / @Sandeep Dutta ,

Actually those client script is working fine for annotation. but those script throws error for 

"There is a JavaScript error in your browser console" and shows error. Please guide me. $ function not supported .

find_real_file.png

Ankur Bawiskar
Tera Patron
Tera Patron

@absnow 

Can you share screenshot of how the annotation looks like on portal form?

I believe annotations rendered on native and rendered on portal are in different manner.

Regards
Ankur

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

Hi Ankur,

Annotation script throws error when open any task from email with portal view . can you please guide please ?

Hi,

you didn't share screenshots of the form where and how the annotation is shown

regards
Ankur

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