Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

Hide Form Annotation in Workspace solution

phgdet
Mega Sage

As I was struggling to find an article/solved question to achieve this requirement recently, I want to share my trick to get it done.

Unfortunately, DOM manipulation is not supported in Workspace. As a result, even if you create an HTML annotation wrapped in a <span> element with a custom ID, none of the common DOM access methods, including document.getElementById(), gel(), or $(), will work.

Here are my steps to achieve it:

  1. Copy the sys_id of annotation in table sys_ui_annotation_type.
  2. Compute this string: annotation.<the sys_id>
  3. Use it as a element with g_form.setDisplay as below
g_form.setDisplay("annotation.<the sys_id>", false);

 It will not work in server-side form so that please mark it to use in Workspace only via:

Run scripts in UI type = Mobile / Service Portal
 
Hope this helps.

 

0 REPLIES 0