Add a scroll bar for particular section in normal form

deepanshanand
Kilo Expert

hi experts, 

is it possible to add a scroll bar in a normal form for a particular section.

1 ACCEPTED SOLUTION

Sagar Patro
Kilo Guru

It can be a CSS trick manipulating the DOM elements. Remember, it is never a good idea to make DOM manipulation.

Coming on to the solution,

1. Go to Form Sections/sys_ui_section table and find the section which you would like to have scroll on. 

2. Copy the sys_id of the record.

3. Write an on load client script on the target table, for this example, I will assume it to be Incident.

Demo:

On my developer instances, the form section for Incident Notes section is "991f88d20a00064127420bc37824d385"

So the client script would be 

var sec_el = document.getElementById("991f88d20a00064127420bc37824d385");//Sys ID of the section.

if(sec_el){

   sec_el.style.maxHeight = "100px"; //Update based on your need
   sec_el.style.overflow = "scroll";

}

 

find_real_file.png

Have fun!

Mark it as Correct and Helpful based on the impact of the solution.

View solution in original post

5 REPLIES 5

Dante Ditan
Kilo Sage

Yes it can be done using client script and add a jquery css to add the scroll depending on the element /  form you wish to achieve.

Hi Dante , 

i am using below onload client script , where i want to bring scroll bar for section : Worklog

function onLoad() {
//Type appropriate comment here, and begin script below
var section = $$('span[tab_caption_raw="Worklog"]')[0].select('span[id*=Worklog.]')[0];

function myFunction() {
var elmnt = document.getElementById("Worklog");
elmnt.scrollIntoView();
}
}

 

Any idea where i am going wrong..

if you try to copy and paste the value of the section does it getting the correct element? Try to put setTimeout on your code

Sagar Patro
Kilo Guru

It can be a CSS trick manipulating the DOM elements. Remember, it is never a good idea to make DOM manipulation.

Coming on to the solution,

1. Go to Form Sections/sys_ui_section table and find the section which you would like to have scroll on. 

2. Copy the sys_id of the record.

3. Write an on load client script on the target table, for this example, I will assume it to be Incident.

Demo:

On my developer instances, the form section for Incident Notes section is "991f88d20a00064127420bc37824d385"

So the client script would be 

var sec_el = document.getElementById("991f88d20a00064127420bc37824d385");//Sys ID of the section.

if(sec_el){

   sec_el.style.maxHeight = "100px"; //Update based on your need
   sec_el.style.overflow = "scroll";

}

 

find_real_file.png

Have fun!

Mark it as Correct and Helpful based on the impact of the solution.