Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

HTML Fields spacing issue

nedunoorish
Giga Contributor

we are creating custom security table same as security incident table (sn_si_incident) .after closing the security incident then all field on the form should be readonly we are doing this using client script in our custom security table the issue is in the custom table the after closing the incident HTML field are showing as
below image 2 but it should show like image 1
how to fix this issue

Image 1:-

fa38794a-cfe0-4d2f-92e1-9fdf3f7ad4d5.jpg 
     Image 2:-

custom security html field.jpg

2 REPLIES 2

Naveen20
ServiceNow Employee
g_form.setReadOnly() doesn't render HTML fields properly — it hides the TinyMCE editor but doesn't show the content. 
Try this fix: Replace client script with a UI Policy

UI Policies → New for your table
Condition: State is Closed
Check On load = true, Reverse if false = true
UI Policy Actions: add each field with Read only = True

Tanushree Maiti
Kilo Patron

Hi @nedunoorish 

 

Refer : KB0596688 Making HTML variable read-only still shows the editor bar and large text box 

 

  1. Have HTML field read-only (the editor controls are still visible, but disabled).
    Use a UI Policy or Client Script on the html variable.

  2. Have HTML field read-only as a text area without editor control.
    Update the WRITE ROLES and CREATE ROLES on HTML variable with a role like nobody or admin.

Also refer: KB0861119 The HTML field is showing a blank space and not reduced to lesser size when the field is m... 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: