Client script of UI page is not getting executed onloand when called from UI action

Shanti7
Tera Contributor

Hi, 

We have a function created in the Client script of UI page and trying to execute it on the load of the UI page. 

<body onload = 'sayHello()'></body>
 
when I use try it on UI page, the function getting executed, however when I call ui page from ui action, it is not working. 
 

 

Shanti7_0-1731679003920.png

 

Shanti7_1-1731679029200.png

 

Has anyone experienced the similar issue and know how to call client script on load? 

 

Thank you

Shanti

 

1 REPLY 1

Juhi Poddar
Kilo Patron

Hello @Shanti7 

PLease try below scripts:

  • Jelly script:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
	<body onload="sayHello()"></body>
</j:jelly>
  • Client script:
function sayHello() {
    alert("Hello");
}
  • UI action:
function openPage() {
	var gdwUploadSheet = new GlideDialogWindow('pageName');//change it as per your record
	gdwUploadSheet.setSize(400,400);
	gdwUploadSheet.render();
}

JuhiPoddar_0-1731697234006.png

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps others find the solution more easily and supports the community!"

 

Thank You
Juhi Poddar