How to hide annotation using client script for scoped application

Karishma Dubey
Tera Expert

Hi Team,

I was trying to hide annotation for specific related service. However, it is not working. Please suggest. Related services is a reference field. Isolate script is false and UI type = "All"

 

//onload client scipt

  var rel_services = g_form.getReference('related_service').toString();
    //getValue('related_service');
    alert(rel_services);
     if (rel_services == "67a3e8301b8c62d00b9a11739b4bcba2") {
         info1.style.display = 'block';
     }
     else{
        info1.style.display = 'none';
     }
KarishmaDubey_0-1746191860279.png

 

17 REPLIES 17

@Ankur Bawiskar yes after adding document.getElementById('info1').style.display = 'none'; to the debugger and running it. it is working. but in client script it is not hiding. not sure whats the issue.Also isolate script is false. 

@Ankur Bawiskar I am writing the script include for scoped app? do we need some property to get dom work on scoped app?

@Karishma Dubey 

seems there is this system property created which blocks DOM in your scoped app and is true

Search in system property and make that as false

<scopeName>.glide.script.block.client.globals

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Karishma Dubey 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Karishma Dubey 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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