Onload Client Script not working in Agent workspace

Michael_Nash
Tera Contributor

I have the below onload Client script and is working perfectly in UI16 however i need the banner to also show in Agent Workspace.

 

function onLoad() {
    var isEvTruck = g_form.getValue('u_ev_truck');
    if (isEvTruck === 'true') { // Check if the value is a string 'true'
        // Create a banner element
        var banner = document.createElement('div');
        banner.style.backgroundColor = 'lightgreen';
        banner.style.color = 'black'; // You can adjust the text color
        banner.style.padding = '10px';
        banner.style.fontWeight = 'bold';
        banner.style.textAlign = 'center';
        banner.innerText = 'This is an EV Truck!';

        // Insert the banner at the top of the form
        var formHeader = g_form.getFormElement().firstChild;
        g_form.getFormElement().insertBefore(banner, formHeader);
    }
}
 
Michael_Nash_0-1698398364755.png

 

6 REPLIES 6

Harsh_Deep
Giga Sage
Giga Sage

Hello @Michael_Nash 

 

On the Client script you have one option UI Type

Please select Ui Type - All

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.

@Harsh_Deep That is already set.

 

Michael_Nash_0-1698403719248.png

 

Hello @Michael_Nash 

 

Make Isolate Script checkbox as false.

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.

I have changed that still not displaying in Agent Workspace.