The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How to call onload script in jelly

jeevitha3
Kilo Contributor

Hi All,

I have a dynamic block on homepage , in dynamic content I have created a button and onclick of button I am calling a function and based on the input(userid) given , reports will be populated for that particular user. This is working fine.

But i want the same functionality ,When the homepage loads, it should get logged in user id and populate records.

I tried calling function in div tag but its not working, how to call function onload in jelly script.

Thanks in advance.

1 ACCEPTED SOLUTION

Add this to your existing script below xyz function defintion



addLoadEvent( function() {  


xyz();  


});


View solution in original post

13 REPLIES 13

Add this to your existing script below xyz function defintion



addLoadEvent( function() {  


xyz();  


});


Thanks Kalai, it worked.


Hi Jeevitha,



Have a body tag with onLoad function similar to below and try using the same



<body onLoad="check123()">



In the script tag have this function and perform the necessary steps.



Mark my reply as Correct and also hit Like and Helpful if you find my response worthy.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thanks for your response Ankur.